[Pkg-gnupg-commit] [libassuan] 129/437: * configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM. Add -lwsock2 to the config lib flags for W32.
Eric Dorland
eric at moszumanska.debian.org
Fri May 22 05:33:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit b259303b8e42a0b2b98cadb76abf10de817ea838
Author: Werner Koch <wk at gnupg.org>
Date: Tue Dec 7 11:09:50 2004 +0000
* configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM.
Add -lwsock2 to the config lib flags for W32.
* assuan-logging.c, assuan-io.c: Include config.h
* assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return
error Not Imlemented.
---
ChangeLog | 5 +++++
configure.ac | 31 +++++++++++++++++++++++++++++++
src/ChangeLog | 10 ++++++++++
src/assuan-buffer.c | 2 +-
src/assuan-connect.c | 2 +-
src/assuan-defs.h | 6 +++---
src/assuan-domain-connect.c | 10 +++++-----
src/assuan-io.c | 12 ++++++++----
src/assuan-logging.c | 4 ++++
src/assuan-pipe-connect.c | 21 ++++++++++++++-------
src/assuan-socket-connect.c | 2 +-
src/assuan-socket-server.c | 2 +-
src/assuan-socket.c | 10 +++++-----
13 files changed, 89 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 77be793..5c5125d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-07 Werner Koch <wk at g10code.com>
+
+ * configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM.
+ Add -lwsock2 to the config lib flags for W32.
+
2004-11-25 Werner Koch <wk at g10code.com>
Released 0.6.8.
diff --git a/configure.ac b/configure.ac
index 6afb7c2..fc26128 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,12 +67,43 @@ if test "$GCC" = yes; then
fi
+#
+# Options depending on the host OS.
+#
+have_dosish_system=no
+have_w32_system=no
+case "${host}" in
+ *-mingw32*)
+ have_dosish_system=yes
+ have_w32_system=yes
+ ;;
+esac
+
+if test "$have_dosish_system" = yes; then
+ AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
+ [Defined if we run on some of the PCDOS like systems
+ (DOS, Windoze. OS/2) with special properties like
+ no file modes])
+fi
+dnl AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
+
+if test "$have_w32_system" = yes; then
+ AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
+fi
+dnl AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
+
+
+
# For src/libassuan-config.in
LIBASSUAN_CONFIG_LIBS="-lassuan"
LIBASSUAN_CONFIG_CFLAGS=""
+if test "$have_w32_system" = yes; then
+ LIBASSUAN_CONFIG_LIBS="$LIBASSUAN_CONFIG_LIBS -lwsock32"
+fi
AC_SUBST(LIBASSUAN_CONFIG_LIBS)
AC_SUBST(LIBASSUAN_CONFIG_CFLAGS)
+
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h locale.h sys/uio.h])
diff --git a/src/ChangeLog b/src/ChangeLog
index 36fbe80..f46d346 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2004-12-07 Werner Koch <wk at g10code.com>
+
+ * assuan-logging.c, assuan-io.c: Include config.h
+
+ Replaced all usages of _WIN32 by the new HAVE_W32_SYSTEM because
+ there is nothing winning in this API.
+
+ * assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return
+ error Not Imlemented.
+
2004-11-27 Werner Koch <wk at g10code.com>
* assuan-socket.c: Include sys/types.h. Noted by Michael
diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c
index 873178d..73ec828 100644
--- a/src/assuan-buffer.c
+++ b/src/assuan-buffer.c
@@ -25,7 +25,7 @@
#include <errno.h>
#include <unistd.h>
#include <assert.h>
-#ifdef _WIN32
+#ifdef HAVE_W32_SYSTEM
#include <process.h>
#endif
#include "assuan-defs.h"
diff --git a/src/assuan-connect.c b/src/assuan-connect.c
index 4774e53..f11d592 100644
--- a/src/assuan-connect.c
+++ b/src/assuan-connect.c
@@ -29,7 +29,7 @@
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/wait.h>
#endif
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 48463b3..6e23771 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -22,7 +22,7 @@
#define ASSUAN_DEFS_H
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#else
@@ -32,13 +32,13 @@
#include "assuan.h"
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#define DIRSEP_C '/'
#else
#define DIRSEP_C '\\'
#endif
-#ifdef _WIN32
+#ifdef HAVE_W32_SYSTEM
#define AF_LOCAL AF_UNIX
/* We need to prefix the structure with a sockaddr_in header so we can
use it later for sendto and recvfrom. */
diff --git a/src/assuan-domain-connect.c b/src/assuan-domain-connect.c
index 1ac5f18..b55e9c3 100644
--- a/src/assuan-domain-connect.c
+++ b/src/assuan-domain-connect.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#else
@@ -90,7 +90,7 @@ domain_reader (assuan_context_t ctx, void *buf, size_t buflen)
{
int len = ctx->domainbuffersize;
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
start:
if (len == 0)
/* No data is buffered. */
@@ -239,7 +239,7 @@ domain_reader (assuan_context_t ctx, void *buf, size_t buflen)
static ssize_t
domain_writer (assuan_context_t ctx, const void *buf, size_t buflen)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
struct msghdr msg;
struct iovec iovec;
ssize_t len;
@@ -273,7 +273,7 @@ domain_writer (assuan_context_t ctx, const void *buf, size_t buflen)
static assuan_error_t
domain_sendfd (assuan_context_t ctx, int fd)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
struct msghdr msg;
struct
{
@@ -317,7 +317,7 @@ domain_sendfd (assuan_context_t ctx, int fd)
static assuan_error_t
domain_receivefd (assuan_context_t ctx, int *fd)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
if (ctx->pendingfds == 0)
{
_assuan_log_printf ("no pending file descriptors!\n");
diff --git a/src/assuan-io.c b/src/assuan-io.c
index cb7971a..3fe11e6 100644
--- a/src/assuan-io.c
+++ b/src/assuan-io.c
@@ -18,17 +18,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "assuan-defs.h"
#include <sys/types.h>
#include <unistd.h>
-#ifdef _WIN32
+#ifdef HAVE_W32_SYSTEM
#include <windows.h>
#endif
extern ssize_t pth_read (int fd, void *buffer, size_t size);
extern ssize_t pth_write (int fd, const void *buffer, size_t size);
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#pragma weak pth_read
#pragma weak pth_write
#endif
@@ -36,7 +40,7 @@ extern ssize_t pth_write (int fd, const void *buffer, size_t size);
ssize_t
_assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size);
#else
return pth_read ? pth_read (ctx->inbound.fd, buffer, size)
@@ -47,7 +51,7 @@ _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size)
ssize_t
_assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size);
#else
return pth_write ? pth_write (ctx->outbound.fd, buffer, size)
diff --git a/src/assuan-logging.c b/src/assuan-logging.c
index 41ead32..d677664 100644
--- a/src/assuan-logging.c
+++ b/src/assuan-logging.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "assuan-defs.h"
#include <stdio.h>
#include <string.h>
diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c
index ce4dfc0..db23648 100644
--- a/src/assuan-pipe-connect.c
+++ b/src/assuan-pipe-connect.c
@@ -17,7 +17,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#ifndef _WIN32
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -30,7 +30,7 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/wait.h>
#else
#include <windows.h>
@@ -44,7 +44,7 @@
#define MAX_OPEN_FDS 20
#endif
-
+#ifndef HAVE_W32_SYSTEM
static int
writen (int fd, const char *buffer, size_t length)
{
@@ -63,8 +63,9 @@ writen (int fd, const char *buffer, size_t length)
}
return 0; /* okay */
}
+#endif
-
+#ifndef HAVE_W32_SYSTEM
static int
do_finish (assuan_context_t ctx)
{
@@ -85,13 +86,15 @@ do_finish (assuan_context_t ctx)
}
return 0;
}
+#endif
+#ifndef HAVE_W32_SYSTEM
static void
do_deinit (assuan_context_t ctx)
{
do_finish (ctx);
}
-
+#endif
/* Connect to a server over a pipe, creating the assuan context and
@@ -102,11 +105,15 @@ do_deinit (assuan_context_t ctx)
argument and 0 is passed as the second argument. The ATFORK
function should only act if the second value is 0. */
assuan_error_t
-assuan_pipe_connect2 (assuan_context_t *ctx, const char *name, char *const argv[],
+assuan_pipe_connect2 (assuan_context_t *ctx,
+ const char *name, char *const argv[],
int *fd_child_list,
void (*atfork) (void *opaque, int reserved),
void *atforkvalue)
{
+#ifdef HAVE_W32_SYSTEM
+ return ASSUAN_Not_Implemented;
+#else
static int fixed_signals = 0;
assuan_error_t err;
int rp[2];
@@ -288,6 +295,7 @@ assuan_pipe_connect2 (assuan_context_t *ctx, const char *name, char *const argv[
}
return err;
+#endif
}
@@ -301,4 +309,3 @@ assuan_pipe_connect (assuan_context_t *ctx, const char *name, char *const argv[]
{
return assuan_pipe_connect2 (ctx, name, argv, fd_child_list, NULL, NULL);
}
-#endif
diff --git a/src/assuan-socket-connect.c b/src/assuan-socket-connect.c
index 3a88e5f..1902f13 100644
--- a/src/assuan-socket-connect.c
+++ b/src/assuan-socket-connect.c
@@ -26,7 +26,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#else
diff --git a/src/assuan-socket-server.c b/src/assuan-socket-server.c
index 7585aa8..275af42 100644
--- a/src/assuan-socket-server.c
+++ b/src/assuan-socket-server.c
@@ -24,7 +24,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#else
diff --git a/src/assuan-socket.c b/src/assuan-socket.c
index 1c4e486..005f730 100644
--- a/src/assuan-socket.c
+++ b/src/assuan-socket.c
@@ -19,7 +19,7 @@
*/
#include <config.h>
#include <stdio.h>
-#ifdef _WIN32
+#ifdef HAVE_W32_SYSTEM
#include <windows.h>
#include <io.h>
#else
@@ -31,7 +31,7 @@
int
_assuan_close (int fd)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return close (fd);
#else
int rc = closesocket (fd);
@@ -45,7 +45,7 @@ _assuan_close (int fd)
int
_assuan_sock_new (int domain, int type, int proto)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return socket (domain, type, proto);
#else
if (domain == AF_UNIX || domain == AF_LOCAL)
@@ -58,7 +58,7 @@ _assuan_sock_new (int domain, int type, int proto)
int
_assuan_sock_connect (int sockfd, struct sockaddr * addr, int addrlen)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return connect (sockfd, addr, addrlen);
#else
struct sockaddr_in myaddr;
@@ -93,7 +93,7 @@ _assuan_sock_connect (int sockfd, struct sockaddr * addr, int addrlen)
int
_assuan_sock_bind (int sockfd, struct sockaddr * addr, int addrlen)
{
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
return bind (sockfd, addr, addrlen);
#else
if (addr->sa_family == AF_LOCAL || addr->sa_family == AF_UNIX)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list