[svn] assuan - r390 - in trunk: . contrib contrib/conf-w32ce-msc src
svn author wk
cvs at cvs.gnupg.org
Mon Nov 1 15:57:14 CET 2010
Author: wk
Date: 2010-11-01 15:57:12 +0100 (Mon, 01 Nov 2010)
New Revision: 390
Added:
trunk/contrib/
trunk/contrib/conf-w32ce-msc/
trunk/contrib/conf-w32ce-msc/build.mk
trunk/contrib/conf-w32ce-msc/config.h
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/src/ChangeLog
trunk/src/assuan-buffer.c
trunk/src/assuan-defs.h
trunk/src/assuan-io.c
trunk/src/assuan-listen.c
trunk/src/assuan-logging.c
trunk/src/assuan-pipe-connect.c
trunk/src/assuan-pipe-server.c
trunk/src/assuan-socket-connect.c
trunk/src/assuan-socket-server.c
trunk/src/assuan-socket.c
trunk/src/assuan-uds.c
trunk/src/assuan.h.in
trunk/src/debug.c
trunk/src/debug.h
trunk/src/mkheader.c
trunk/src/posix-fd-t.inc.h
trunk/src/system-w32ce.c
trunk/src/system.c
trunk/src/sysutils.c
trunk/src/w32-fd-t.inc.h
trunk/src/w32-types.inc.h
trunk/src/w32ce-fd-t.inc.h
Log:
Changes to allow building the CE version with MSC.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/ChangeLog 2010-11-01 14:57:12 UTC (rev 390)
@@ -1,3 +1,11 @@
+2010-11-01 Werner Koch <wk at g10code.com>
+
+ * configure.ac: Check for sys/types.h, sys/stat.h, sys/time and
+ unistd.h
+
+ * contrib/conf-w32ce-msc/build.mk: New.
+ * contrib/conf-w32ce-msc/config.h: New.
+
2010-08-19 Werner Koch <wk at g10code.com>
* configure.ac (AH_TOP, AH_BOTTOM): New. Define
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/ChangeLog 2010-11-01 14:57:12 UTC (rev 390)
@@ -1,3 +1,31 @@
+2010-11-01 Werner Koch <wk at g10code.com>
+
+ * assuan-socket.c (S_IRUSR) [W32]: Define if not defined.
+
+ * sysutils.c: Remove include of devload.h.
+
+ * assuan-defs.h [HAVE_WINSOCK2_H]: Include winsock2.h prior to
+ windows.h.
+ * assuan-pipe-server.c: Ditto.
+ * sysutils.c: Ditto.
+ * assuan-socket-server.c: Ditto.
+ * assuan-pipe-connect.c: Ditto.
+ * assuan-socket-connect.c: Ditto.
+ * assuan-uds.c: Ditto.
+ * assuan-logging.c: Ditto.
+ * system-w32ce.c: Ditto.
+ * assuan-io.c: Ditto.
+
+ * w32-types.inc.h [_MSC_VER]: Define ssize_t and pid_t.
+
+ * w32ce-fd-t.inc.h, w32-fd-t.inc.h, posix-fd-t.inc.h, debug.h:
+ s/inline/GPG_ERR_INLINE/.
+ * assuan.h.in: Let mkheader write the sys/types.h and unistd.h
+ include lines.
+ * mkheader.c: Change accordingly.
+
+ Guard include of sys/types.h, sys/stat.h, sys/time.h and unistd.h.
+
2010-09-17 Werner Koch <wk at g10code.com>
* assuan-socket-connect.c (INADDR_NONE): New replacement. Fixes
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/configure.ac 2010-11-01 14:57:12 UTC (rev 390)
@@ -249,7 +249,8 @@
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([string.h locale.h sys/uio.h stdint.h inttypes.h])
+AC_CHECK_HEADERS([string.h locale.h sys/uio.h stdint.h inttypes.h \
+ sys/types.h sys/stat.h unistd.h sys/time.h])
AC_TYPE_UINTPTR_T
AC_TYPE_UINT16_T
Added: trunk/contrib/conf-w32ce-msc/build.mk
===================================================================
--- trunk/contrib/conf-w32ce-msc/build.mk (rev 0)
+++ trunk/contrib/conf-w32ce-msc/build.mk 2010-11-01 14:57:12 UTC (rev 390)
@@ -0,0 +1,158 @@
+# build.mk - Makefile to build libgpg-error using Visual-C
+# Copyright 2010 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This is a helper make script to build libgpg-error for WindowsCE
+# using the Microsoft Visual C compiler.
+
+# The target build directry where we run the Visual C compiler/
+# This needs to be an absolute directory name.
+targetdir = /home/smb/xppro-gnu/src/libassuan
+
+
+help:
+ @echo "Run "
+ @echo " make -f ../contrib/conf-w32ce-msc/build.mk copy-source"
+ @echo "on the POSIX system and then"
+ @echo " nmake -f build.mk all"
+ @echo "on the Windows system"
+
+ce_defines = -DWINCE -D_WIN32_WCE=0x502 -DUNDER_CE \
+ -DWIN32_PLATFORM_PSPC -D_UNICODE -DUNICODE \
+ -D_CONSOLE -DARM -D_ARM_
+#-D_DEBUG -DDEBUG
+
+# Some options of Visual-C:
+# -W3 Set warning level 3
+# -Zi Generate debug info
+# -Od Disable optimization
+# -Gm Enable minimal rebuild (for C++)
+# -EHsc Exception handling model sc
+# -MTd Create a debug multithreaded executable
+# -fp: Floating point behaviour
+# -GR- Disable runtime type information
+# -Os Favor small code
+# -LD Create a DLL
+# -Fe Set executable output name (may be only a directory)
+CFLAGS = -nologo -W3 -fp:fast -Os $(ce_defines) \
+ -DHAVE_CONFIG_H -DDLL_EXPORT -D_CRT_SECURE_NO_WARNINGS \
+ -I. -Igpg-extra -I../libgpg-error
+
+LDFLAGS =
+
+# Standard source files
+sources = \
+ assuan.c \
+ context.c \
+ system.c \
+ debug.c \
+ conversion.c \
+ sysutils.c \
+ client.c \
+ server.c \
+ assuan-error.c \
+ assuan-buffer.c \
+ assuan-handler.c \
+ assuan-inquire.c \
+ assuan-listen.c \
+ assuan-pipe-server.c \
+ assuan-socket-server.c \
+ assuan-pipe-connect.c \
+ assuan-socket-connect.c \
+ assuan-uds.c \
+ assuan-logging.c \
+ assuan-socket.c \
+ system-w32ce.c \
+ assuan-io.c \
+ putc_unlocked.c \
+ memrchr.c \
+ stpcpy.c \
+ setenv.c \
+ vasprintf.c \
+ assuan-defs.h \
+ debug.h \
+ libassuan.def
+
+# The object files we need to create from sources.
+objs = \
+ assuan.obj \
+ context.obj \
+ system.obj \
+ debug.obj \
+ conversion.obj \
+ sysutils.obj \
+ client.obj \
+ server.obj \
+ assuan-error.obj \
+ assuan-buffer.obj \
+ assuan-handler.obj \
+ assuan-inquire.obj \
+ assuan-listen.obj \
+ assuan-pipe-server.obj \
+ assuan-socket-server.obj \
+ assuan-pipe-connect.obj \
+ assuan-socket-connect.obj \
+ assuan-uds.obj \
+ assuan-logging.obj \
+ assuan-socket.obj \
+ system-w32ce.obj \
+ assuan-io.obj \
+ putc_unlocked.obj \
+ memrchr.obj \
+ stpcpy.obj \
+ setenv.obj \
+ vasprintf.obj
+
+
+# Sources files in this directory inclduing this Makefile
+conf_sources = \
+ build.mk \
+ config.h
+
+# Source files built by running the standard build system.
+built_sources = \
+ assuan.h
+
+copy-static-source:
+ @if [ ! -f ./assuan-defs.h ]; then \
+ echo "Please cd to the src/ directory first"; \
+ exit 1; \
+ fi
+ cp -t $(targetdir) $(sources);
+ cd ../contrib/conf-w32ce-msc ; cp -t $(targetdir) $(conf_sources)
+
+
+copy-built-source:
+ @if [ ! -f ./assuan.h ]; then \
+ echo "Please build using ./autogen.sh --build-w32ce first"; \
+ exit 1; \
+ fi
+ cp -t $(targetdir) $(built_sources)
+
+copy-source: copy-static-source copy-built-source
+
+
+.c.obj:
+ $(CC) $(CFLAGS) -c $<
+
+all: $(sources) $(conf_sources) $(built_sources) $(objs)
+ link /DLL /IMPLIB:libassuan-0-msc.lib \
+ /OUT:libassuan-0-msc.dll \
+ /DEF:libassuan.def /NOLOGO /MANIFEST:NO \
+ /NODEFAULTLIB:"oldnames.lib" /DYNAMICBASE:NO \
+ $(objs) \
+ coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib \
+ commctrl.lib /subsystem:windowsce,5.02
+
+# Note that install needs to be run on the POSIX platform and the all
+# is only to make sure we build everything; it won't compile anything
+# because Visual-C is probably not installed on that platform.
+install: all
+ @echo fixme Install the files
Property changes on: trunk/contrib/conf-w32ce-msc/build.mk
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/contrib/conf-w32ce-msc/config.h
===================================================================
--- trunk/contrib/conf-w32ce-msc/config.h (rev 0)
+++ trunk/contrib/conf-w32ce-msc/config.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -0,0 +1,184 @@
+/* config.h for building with Visual-C for WindowsCE.
+ * Copyright 2010 g10 Code GmbH
+ *
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/* This file was originally created by running
+ * ./autogen.sh --build-w32ce
+ * on svn revision 389 (libassuan 2.0.2-svn389) and then adjusted to work
+ * with Visual-C.
+ */
+
+#ifndef _ASSUAN_CONFIG_H_INCLUDED
+#define _ASSUAN_CONFIG_H_INCLUDED
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.0.2-svn389-msc1"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libassuan " PACKAGE_VERSION
+
+/* Name of this package */
+#define PACKAGE "libassuan"
+
+/* Bug report address */
+#define PACKAGE_BUGREPORT "bug-libassuan at gnupg.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libassuan"
+
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libassuan"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Version of this package */
+#define VERSION PACKAGE_VERSION
+
+
+/* Enable gpg-error's strerror macro under W32CE. */
+#define GPG_ERR_ENABLE_ERRNO_MACROS 1
+
+
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_SIGLIST 0
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2)
+ with special properties like no file modes */
+#define HAVE_DOSISH_SYSTEM 1
+
+/* Define to 1 if you have the `flockfile' function. */
+/* #undef HAVE_FLOCKFILE */
+
+/* Define to 1 if you have the `fopencookie' function. */
+/* #undef HAVE_FOPENCOOKIE */
+
+/* Define to 1 if you have the `funlockfile' function. */
+/* #undef HAVE_FUNLOCKFILE */
+
+/* Define to 1 if you have the `funopen' function. */
+/* #undef HAVE_FUNOPEN */
+
+/* Define to 1 if you have the `inet_pton' function. */
+/* #undef HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the `isascii' function. */
+#define HAVE_ISASCII 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+/* #undef HAVE_LOCALE_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memrchr' function. */
+/* #undef HAVE_MEMRCHR */
+
+/* Define to 1 if you have the `nanosleep' function in libc. */
+/* #undef HAVE_NANOSLEEP */
+
+/* Define to 1 if you have the `putc_unlocked' function. */
+/* #undef HAVE_PUTC_UNLOCKED */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef HAVE_SETENV */
+
+/* Defined if SO_PEERCRED is supported (Linux specific) */
+/* #undef HAVE_SO_PEERCRED */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stpcpy' function. */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+/* #undef HAVE_SYS_STAT_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+/* #undef HAVE_SYS_TYPES_H */
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+/* #undef HAVE_SYS_UIO_H */
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#define HAVE_UINTPTR_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Defined if we run on WindowsCE */
+#define HAVE_W32CE_SYSTEM 1
+
+/* Defined if we run on a W32 API based system */
+#define HAVE_W32_SYSTEM 1
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#define HAVE_WS2TCPIP_H 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Defined if descriptor passing is supported */
+/* #undef USE_DESCRIPTOR_PASSING */
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+
+
+/* snprintf is not part of oldnames.lib thus we redefine it here. */
+#define snprintf _snprintf
+
+
+#endif /*_ASSUAN_CONFIG_H_INCLUDED*/
+
Modified: trunk/src/assuan-buffer.c
===================================================================
--- trunk/src/assuan-buffer.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-buffer.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -22,10 +22,12 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <assert.h>
#ifdef HAVE_W32_SYSTEM
-#include <process.h>
+# include <process.h>
#endif
#include "assuan-defs.h"
Modified: trunk/src/assuan-defs.h
===================================================================
--- trunk/src/assuan-defs.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-defs.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -21,14 +21,22 @@
#ifndef ASSUAN_DEFS_H
#define ASSUAN_DEFS_H
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifndef HAVE_W32_SYSTEM
-#include <sys/socket.h>
-#include <sys/un.h>
+# include <sys/socket.h>
+# include <sys/un.h>
#else
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# /* Avoid inclusion of winsock.h via windows.h. */
+# include <winsock2.h>
+# endif
+# include <windows.h>
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include "assuan.h"
Modified: trunk/src/assuan-io.c
===================================================================
--- trunk/src/assuan-io.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-io.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -22,14 +22,23 @@
#endif
#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <errno.h>
#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
#else
# include <sys/wait.h>
Modified: trunk/src/assuan-listen.c
===================================================================
--- trunk/src/assuan-listen.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-listen.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -24,7 +24,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <errno.h>
#include "assuan-defs.h"
Modified: trunk/src/assuan-logging.c
===================================================================
--- trunk/src/assuan-logging.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-logging.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -26,7 +26,10 @@
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_W32_SYSTEM
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
#endif /*HAVE_W32_SYSTEM*/
#include <errno.h>
#include <ctype.h>
Modified: trunk/src/assuan-pipe-connect.c
===================================================================
--- trunk/src/assuan-pipe-connect.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-pipe-connect.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -29,14 +29,21 @@
#ifndef HAVE_DOSISH_SYSTEM
# include <signal.h>
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifndef HAVE_W32_SYSTEM
-#include <sys/wait.h>
+# include <sys/wait.h>
#else
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
#endif
#include "assuan-defs.h"
Modified: trunk/src/assuan-pipe-server.c
===================================================================
--- trunk/src/assuan-pipe-server.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-pipe-server.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -23,12 +23,21 @@
#include <stdlib.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#ifdef HAVE_W32_SYSTEM
-#include <windows.h>
-#include <fcntl.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
+# include <fcntl.h>
#endif
#include "assuan-defs.h"
Modified: trunk/src/assuan-socket-connect.c
===================================================================
--- trunk/src/assuan-socket-connect.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-socket-connect.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -26,9 +26,16 @@
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
-#include <unistd.h>
-#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
#else
# include <sys/socket.h>
Modified: trunk/src/assuan-socket-server.c
===================================================================
--- trunk/src/assuan-socket-server.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-socket-server.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -24,9 +24,16 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
# if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
Modified: trunk/src/assuan-socket.c
===================================================================
--- trunk/src/assuan-socket.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-socket.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -24,16 +24,18 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_W32_SYSTEM
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <wincrypt.h>
-#include <io.h>
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include <wincrypt.h>
+# include <io.h>
#else
-#include <sys/types.h>
-#include <sys/socket.h>
+# include <sys/types.h>
+# include <sys/socket.h>
#endif
#include <errno.h>
-#include <sys/stat.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#include <fcntl.h>
#include <assert.h>
@@ -53,6 +55,10 @@
#endif
#ifdef HAVE_W32_SYSTEM
+#ifndef S_IRUSR
+# define S_IRUSR 0
+# define S_IWUSR 0
+#endif
#ifndef S_IRGRP
# define S_IRGRP 0
# define S_IWGRP 0
Modified: trunk/src/assuan-uds.c
===================================================================
--- trunk/src/assuan-uds.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan-uds.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -25,17 +25,24 @@
#include <stddef.h>
#include <stdio.h>
#include <errno.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifndef HAVE_W32_SYSTEM
-#include <sys/socket.h>
-#include <sys/un.h>
+# include <sys/socket.h>
+# include <sys/un.h>
#else
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
#endif
#if HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <fcntl.h>
#include <string.h>
#include <assert.h>
Modified: trunk/src/assuan.h.in
===================================================================
--- trunk/src/assuan.h.in 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/assuan.h.in 2010-11-01 14:57:12 UTC (rev 390)
@@ -24,8 +24,8 @@
#define ASSUAN_H
#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
+ at include:sys/types.h@
+ at include:unistd.h@
#include <stdarg.h>
#ifndef _ASSUAN_NO_SOCKET_WRAPPER
Modified: trunk/src/debug.c
===================================================================
--- trunk/src/debug.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/debug.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -26,13 +26,15 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <ctype.h>
#include <errno.h>
#ifndef HAVE_DOSISH_SYSTEM
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <fcntl.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
#endif
#include <assert.h>
Modified: trunk/src/debug.h
===================================================================
--- trunk/src/debug.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/debug.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -39,10 +39,10 @@
/* Remove path components from filenames (i.e. __FILE__) for cleaner
logs. */
-static inline const char *_assuan_debug_srcname (const char *file)
+static GPG_ERR_INLINE const char *_assuan_debug_srcname (const char *file)
ASSUAN_GCC_A_PURE;
-static inline const char *
+static GPG_ERR_INLINE const char *
_assuan_debug_srcname (const char *file)
{
const char *s = strrchr (file, '/');
Modified: trunk/src/mkheader.c
===================================================================
--- trunk/src/mkheader.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/mkheader.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -82,6 +82,24 @@
else
include_file (fname, lnr, "posix-includes.inc.h");
}
+ else if (!strcmp (tag, "include:sys/types.h"))
+ {
+ if (!strcmp (host_os, "mingw32ce"))
+ fputs ("#ifdef __MINGW32CE__\n"
+ "# include <sys/types.h>\n"
+ "#endif\n", stdout);
+ else
+ fputs ("#include <sys/types.h>\n", stdout);
+ }
+ else if (!strcmp (tag, "include:unistd.h"))
+ {
+ if (!strcmp (host_os, "mingw32ce"))
+ fputs ("#ifdef __MINGW32CE__\n"
+ "# include <unistd.h>\n"
+ "#endif\n", stdout);
+ else
+ fputs ("#include <unistd.h>\n", stdout);
+ }
else if (!strcmp (tag, "include:types"))
{
if (strstr (host_os, "mingw32"))
Modified: trunk/src/posix-fd-t.inc.h
===================================================================
--- trunk/src/posix-fd-t.inc.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/posix-fd-t.inc.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -23,7 +23,7 @@
typedef int assuan_fd_t;
#define ASSUAN_INVALID_FD (-1)
#define ASSUAN_INVALID_PID ((pid_t) -1)
-static inline assuan_fd_t
+static GPG_ERR_INLINE assuan_fd_t
assuan_fd_from_posix_fd (int fd)
{
return fd;
Modified: trunk/src/system-w32ce.c
===================================================================
--- trunk/src/system-w32ce.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/system-w32ce.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -26,6 +26,9 @@
#include <errno.h>
#include <time.h>
#include <fcntl.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
#include <windows.h>
#include <winioctl.h>
#include <devload.h>
Modified: trunk/src/system.c
===================================================================
--- trunk/src/system.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/system.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -24,8 +24,10 @@
#include <stdlib.h>
#include <errno.h>
-/* Solaris 8 needs sys/types.h before time.h. */
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+ /* Solaris 8 needs sys/types.h before time.h. */
+# include <sys/types.h>
+#endif
#include <time.h>
#include <fcntl.h>
Modified: trunk/src/sysutils.c
===================================================================
--- trunk/src/sysutils.c 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/sysutils.c 2010-11-01 14:57:12 UTC (rev 390)
@@ -25,10 +25,12 @@
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_W32_SYSTEM
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
# ifdef HAVE_W32CE_SYSTEM
# include <winioctl.h>
-# include <devload.h>
# endif /*HAVE_W32CE_SYSTEM*/
#endif /*HAVE_W32_SYSTEM*/
Modified: trunk/src/w32-fd-t.inc.h
===================================================================
--- trunk/src/w32-fd-t.inc.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/w32-fd-t.inc.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -27,7 +27,7 @@
typedef void *assuan_fd_t;
#define ASSUAN_INVALID_FD ((void*)(-1))
#define ASSUAN_INVALID_PID ((pid_t) -1)
-static inline assuan_fd_t
+static GPG_ERR_INLINE assuan_fd_t
assuan_fd_from_posix_fd (int fd)
{
if (fd < 0)
Modified: trunk/src/w32-types.inc.h
===================================================================
--- trunk/src/w32-types.inc.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/w32-types.inc.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -20,4 +20,10 @@
## This file is included by the mkheader tool. Lines starting with
## a double hash mark are not copied to the destination file.
typedef void *assuan_msghdr_t;
+
+#ifdef _MSC_VER
+ typedef long ssize_t;
+ typedef int pid_t;
+#endif
+
##EOF##
Modified: trunk/src/w32ce-fd-t.inc.h
===================================================================
--- trunk/src/w32ce-fd-t.inc.h 2010-10-11 19:20:25 UTC (rev 389)
+++ trunk/src/w32ce-fd-t.inc.h 2010-11-01 14:57:12 UTC (rev 390)
@@ -23,7 +23,7 @@
typedef void *assuan_fd_t;
#define ASSUAN_INVALID_FD ((void*)(-1))
#define ASSUAN_INVALID_PID ((pid_t) -1)
-static inline assuan_fd_t
+static GPG_ERR_INLINE assuan_fd_t
assuan_fd_from_posix_fd (int fd)
{
return (assuan_fd_t)(fd);
More information about the Gnupg-commits
mailing list