Changeset: 6b719ea7ea94 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b719ea7ea94
Modified Files:
        MonetDB/src/common/monet_getopt.h
        NT/monetdb_config.h.in
Branch: default
Log Message:

Get this thing to compile again on Windows.
After recent changes to configure and the removal of monet_utils.mx,
some changes were needed to get Windows up to speed again.


diffs (173 lines):

diff -r 7efaf4264bc5 -r 6b719ea7ea94 MonetDB/src/common/monet_getopt.h
--- a/MonetDB/src/common/monet_getopt.h Fri Jan 14 13:26:32 2011 +0100
+++ b/MonetDB/src/common/monet_getopt.h Fri Jan 14 13:30:04 2011 +0100
@@ -57,6 +57,19 @@
 extern "C" {
 #endif
 
+#ifndef mutils_export
+/* avoid using "#ifdef WIN32" so that this file does not need our config.h */
+#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+#ifndef LIBMUTILS
+#define mutils_export extern __declspec(dllimport)
+#else
+#define mutils_export extern __declspec(dllexport)
+#endif
+#else
+#define mutils_export extern
+#endif
+#endif
+
 /* For communication from `getopt' to the caller.
    When `getopt' finds an option that takes an argument,
    the argument value is returned here.
diff -r 7efaf4264bc5 -r 6b719ea7ea94 NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in    Fri Jan 14 13:26:32 2011 +0100
+++ b/NT/monetdb_config.h.in    Fri Jan 14 13:30:04 2011 +0100
@@ -451,7 +451,6 @@
 
 /* Define to 1 if the system has the type `socklen_t'. */
 #define HAVE_SOCKLEN_T 1
-typedef int socklen_t;
 
 /* Define if you have the sphinxclient library */
 /* #undef HAVE_SPHINXCLIENT */
@@ -459,9 +458,6 @@
 /* Define if you have the SQLGetPrivateProfileString function */
 #define HAVE_SQLGETPRIVATEPROFILESTRING 1
 
-/* Define to 1 if the system has the type `ssize_t'. */
-#define HAVE_SSIZE_T 1         /* see below */
-
 /* Define to 1 if stdbool.h conforms to C99. */
 /* #undef HAVE_STDBOOL_H */
 
@@ -621,7 +617,7 @@
 /* Define to 1 if you have the <utime.h> header file. */
 /* #undef HAVE_UTIME_H */
 
-/* Define when uuid_* is available and linkable on this system */
+/* uuid */
 /* #undef HAVE_UUID */
 
 /* Define to 1 if you have the <uuid/uuid.h> header file. */
@@ -798,40 +794,24 @@
 #define SIZEOF_LONG_LONG 8
 #endif
 
+/* The size of `ptrdiff_t', as computed by sizeof. */
+#ifdef _WIN64
+#define SIZEOF_PTRDIFF_T 8
+#else
+#define SIZEOF_PTRDIFF_T 4
+#endif
+
 /* The size of `short', as computed by sizeof. */
 #define SIZEOF_SHORT 2
 
-#ifdef _WIN64
-
-/* The size of `ptrdiff_t', as computed by sizeof. */
-#define SIZEOF_PTRDIFF_T 8
-
 /* The size of `size_t', as computed by sizeof. */
-#define SIZEOF_SIZE_T 8
+#define SIZEOF_SIZE_T SIZEOF_PTRDIFF_T
 
 /* The size of `ssize_t', as computed by sizeof. */
-#define SIZEOF_SSIZE_T 8
-typedef __int64 ssize_t;
+#define SIZEOF_SSIZE_T SIZEOF_PTRDIFF_T
 
 /* The size of `void *', as computed by sizeof. */
-#define SIZEOF_VOID_P 8
-
-#else
-
-/* The size of `ptrdiff_t', as computed by sizeof. */
-#define SIZEOF_PTRDIFF_T 4
-
-/* The size of `size_t', as computed by sizeof. */
-#define SIZEOF_SIZE_T 4
-
-/* The size of `ssize_t', as computed by sizeof. */
-#define SIZEOF_SSIZE_T 4
-typedef int ssize_t;
-
-/* The size of `void *', as computed by sizeof. */
-#define SIZEOF_VOID_P 4
-
-#endif /* _WIN64 */
+#define SIZEOF_VOID_P SIZEOF_PTRDIFF_T
 
 /* The size of `__int64', as computed by sizeof. */
 #define SIZEOF___INT64 8
@@ -956,6 +936,7 @@
 #define __attribute__(a)
 #endif
 
+
 /* function to close a socket */
 /* #undef closesocket */
 
@@ -984,7 +965,14 @@
 #endif
 
 /* type used by connect */
-/* #undef socklen_t */
+#define socklen_t int
+
+/* Define to `int' if <sys/types.h> does not define. */
+#ifdef _WIN64
+#define ssize_t __int64
+#else
+#define ssize_t int
+#endif
 
 /* no va_copy in win32 */
 #define va_copy(x,y) ((x) = (y))
@@ -1033,3 +1021,44 @@
 #if (ALGEBRA_IS_DEFAULT + MILPRINT_SUMMER_IS_DEFAULT + SQL_IS_DEFAULT) != 1
 #error "Only one of ALGEBRA_IS_DEFAULT, MILPRINT_SUMMER_IS_DEFAULT, 
SQL_IS_DEFAULT can be set to 1"
 #endif
+
+#ifndef _SEEN_MONETDB_CONFIG_H
+#define _SEEN_MONETDB_CONFIG_H 1
+
+#include <sys/types.h>
+#include <stdio.h>             /* NULL, printf etc. */
+#include <stdlib.h>
+#include <errno.h>
+#include <stdarg.h>            /* va_alist.. */
+
+#include <assert.h>
+
+#define SLASH_2_DIR_SEP(s) {char *t; for(t=strchr(s, '/'    ); t; 
t=strchr(t+1, '/'    )) *t=DIR_SEP;}
+#define DIR_SEP_2_SLASH(s) {char *t; for(t=strchr(s, DIR_SEP); t; 
t=strchr(t+1, DIR_SEP)) *t='/'    ;}
+
+#ifdef HAVE_LONG_LONG
+typedef long long lng;
+# define SIZEOF_LNG SIZEOF_LONG_LONG
+#else
+typedef __int64 lng;
+# define SIZEOF_LNG SIZEOF___INT64
+#endif
+
+/* define printf formats for printing size_t and ssize_t variables */
+#if defined(__MINGW32__)
+# define SZFMT "%u"
+# define SSZFMT "%ld"
+#elif SIZEOF_SIZE_T == SIZEOF_INT
+# define SZFMT "%u"
+# define SSZFMT "%d"
+#elif SIZEOF_SIZE_T == SIZEOF_LONG
+# define SZFMT "%lu"
+# define SSZFMT "%ld"
+#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG || SIZEOF_SIZE_T == SIZEOF___INT64
+# define SZFMT ULLFMT
+# define SSZFMT LLFMT
+#else
+# error no definition for SZFMT/SSZFMT
+#endif
+
+#endif /* _SEEN_MONETDB_CONFIG_H */
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to