Changeset: 5c6ad646861c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5c6ad646861c
Modified Files:
NT/monetdb_config.h.in
buildtools/burg/trim.c
clients/odbc/driver/ODBCGlobal.h
common/stream/stream.c
configure.ag
gdk/gdk.mx
Branch: default
Log Message:
Moved definitions of PDFMT and PTRFMT to configure, like SZFMT.
Also removed some old code for alloca that is already handled in
configure.
diffs (truncated from 305 to 300 lines):
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -665,9 +665,6 @@
/* object code libraries */
#define LIBDIR "${exec_prefix}\\lib"
-/* Format to print 64 bit signed integers. */
-#define LLFMT "%I64d"
-
/* modifiable single-machine data */
#define LOCALSTATEDIR "${prefix}\\var"
@@ -843,9 +840,6 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */
-/* Format to print 64 bit unsigned integers. */
-#define ULLFMT "%I64u"
-
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
@@ -1045,6 +1039,12 @@
# define SIZEOF_LNG SIZEOF___INT64
#endif
+/* Format to print 64 bit signed integers. */
+#define LLFMT "%I64d"
+
+/* Format to print 64 bit unsigned integers. */
+#define ULLFMT "%I64u"
+
/* define printf formats for printing size_t and ssize_t variables */
#if defined(__MINGW32__)
# define SZFMT "%u"
@@ -1062,4 +1062,20 @@
# error no definition for SZFMT/SSZFMT
#endif
+#if SIZEOF_PTRDIFF_T == SIZEOF_INT
+#define PDFMT "%d"
+#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
+#define PDFMT "%ld"
+#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG || SIZEOF_PTRDIFF_T ==
SIZEOF___INT64
+#define PDFMT LLFMT
+#else
+#error no definition for PDFMT
+#endif
+
+/* On Windows, always use 64 bit integers (even on 32-bit architectures)
+ * to not get the warning C4311: 'type cast' : pointer truncation from
+ * 'void *' to 'unsigned int' */
+#define PTRFMT "%I64x"
+#define PTRFMTCAST (unsigned __int64)
+
#endif /* _SEEN_MONETDB_CONFIG_H */
diff --git a/buildtools/burg/trim.c b/buildtools/burg/trim.c
--- a/buildtools/burg/trim.c
+++ b/buildtools/burg/trim.c
@@ -14,26 +14,6 @@
static void findAllNexts ARGS((void));
static Relation *newAllPairs ARGS((void));
-/* define printf format for printing pointer values */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
-#define PTRFMT "%p"
-#define PTRFMTCAST /* no cast needed */
-#elif SIZEOF_VOID_P == SIZEOF_INT
-#define PTRFMT "%x"
-#define PTRFMTCAST (unsigned int)
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-#define PTRFMT "%lx"
-#define PTRFMTCAST (unsigned long)
-#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
-#define PTRFMT "%llx"
-#define PTRFMTCAST (unsigned long long)
-#elif SIZEOF_VOID_P == SIZEOF___INT64
-#define PTRFMT "%I64x"
-#define PTRFMTCAST (unsigned __int64)
-#else
-#error no definition for PTRFMT
-#endif
-
static void
siblings(i, j) int i; int j;
{
diff --git a/clients/odbc/driver/ODBCGlobal.h b/clients/odbc/driver/ODBCGlobal.h
--- a/clients/odbc/driver/ODBCGlobal.h
+++ b/clients/odbc/driver/ODBCGlobal.h
@@ -98,48 +98,6 @@
# define strdup _strdup
#endif
-#ifndef HAVE_SSIZE_T
-# if SIZEOF_SIZE_T == SIZEOF_INT
-typedef int ssize_t;
-
-# define HAVE_SSIZE_T 1
-# else
-# if SIZEOF_SIZE_T == SIZEOF_LONG
-typedef long ssize_t;
-
-# define HAVE_SSIZE_T 1
-# else
-# ifdef _WIN64
-typedef __int64 ssize_t;
-
-# define HAVE_SSIZE_T 1
-# endif
-# endif
-# endif
-#endif
-
-/* define printf format for printing pointer values */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
-#define PTRFMT "%p"
-#define PTRFMTCAST /* no cast needed */
-#elif defined(_MSC_VER)
-/* On Windows, always use 64 bit integers (even on 32-bit architectures)
- * to not get the warning C4311: 'type cast' : pointer truncation from
- * 'void *' to 'unsigned int' */
-#define PTRFMT "%I64x"
-#define PTRFMTCAST (unsigned __int64)
-#elif SIZEOF_VOID_P == SIZEOF_INT
-#define PTRFMT "%x"
-#define PTRFMTCAST (unsigned int)
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-#define PTRFMT "%lx"
-#define PTRFMTCAST (unsigned long)
-#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
-#define PTRFMT "%llx"
-#define PTRFMTCAST (unsigned long long)
-#else
-#error no definition for PTRFMT
-#endif
#ifdef SQLLEN /* it's a define for 32, a typedef for 64 */
#define LENFMT "%d"
#define ULENFMT "%u"
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -60,23 +60,6 @@
*/
-/* AC_FUNC_ALLOCA autoconf documented code */
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-
#include "monetdb_config.h"
#include "stream.h"
#include "stream_socket.h"
@@ -195,46 +178,6 @@
/* #define STREAM_DEBUG 1 */
/* #define BSTREAM_DEBUG 1 */
-#ifdef STREAM_DEBUG
-/* code adapted from gdk.mx */
-/* define printf formats for printing size_t and ssize_t variables */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 &&
!defined(__svr4__) && !defined(WIN32) && !defined(__sgi)
-#define SZFMT "%zu"
-#elif SIZEOF_SIZE_T == SIZEOF_INT
-#define SZFMT "%u"
-#elif SIZEOF_SIZE_T == SIZEOF_LONG
-#define SZFMT "%lu"
-#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-#define SZFMT "%llu"
-#elif SIZEOF_SIZE_T == SIZEOF___INT64
-#define SZFMT "%I64u"
-#else
-#error no definition for SZFMT
-#endif
-/* define printf format for printing pointer values */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
-#define PTRFMT "%p"
-#define PTRFMTCAST /* no cast needed */
-#elif defined(_MSC_VER)
-/* On Windows, always use 64 bit integers (even on 32-bit architectures)
- * to not get the warning C4311: 'type cast' : pointer truncation from
- * 'void *' to 'unsigned int' */
-#define PTRFMT "%I64x"
-#define PTRFMTCAST (unsigned __int64)
-#elif SIZEOF_VOID_P == SIZEOF_INT
-#define PTRFMT "%x"
-#define PTRFMTCAST (unsigned int)
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-#define PTRFMT "%lx"
-#define PTRFMTCAST (unsigned long)
-#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
-#define PTRFMT "%llx"
-#define PTRFMTCAST (unsigned long long)
-#else
-#error no definition for PTRFMT
-#endif
-#endif /* STREAM_DEBUG */
-
/* Read at most cnt elements of size elmsize from the stream. Returns
the number of elements actually read. */
ssize_t
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -3426,6 +3426,42 @@
# error no definition for SZFMT/SSZFMT
#endif
+/* define printf formats for printing ptrdiff_t variables */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 &&
!defined(__svr4__) && !defined(WIN32) && !defined(__sgi) || defined(__hpux)
+#define PDFMT "%td"
+#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
+#define PDFMT "%d"
+#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
+#define PDFMT "%ld"
+#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG || SIZEOF_PTRDIFF_T ==
SIZEOF___INT64
+#define PDFMT LLFMT
+#else
+#error no definition for PDFMT
+#endif
+
+/* define printf format for printing pointer values */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
+#define PTRFMT "%p"
+#define PTRFMTCAST /* no cast needed */
+#elif defined(_MSC_VER)
+/* On Windows, always use 64 bit integers (even on 32-bit architectures)
+ * to not get the warning C4311: 'type cast' : pointer truncation from
+ * 'void *' to 'unsigned int' */
+#define PTRFMT "%I64x"
+#define PTRFMTCAST (unsigned __int64)
+#elif SIZEOF_VOID_P == SIZEOF_INT
+#define PTRFMT "%x"
+#define PTRFMTCAST (unsigned int)
+#elif SIZEOF_VOID_P == SIZEOF_LONG
+#define PTRFMT "%lx"
+#define PTRFMTCAST (unsigned long)
+#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
+#define PTRFMT "%llx"
+#define PTRFMTCAST (unsigned long long)
+#else
+#error no definition for PTRFMT
+#endif
+
#endif /* _SEEN_MONETDB_CONFIG_H */
])
diff --git a/gdk/gdk.mx b/gdk/gdk.mx
--- a/gdk/gdk.mx
+++ b/gdk/gdk.mx
@@ -567,42 +567,6 @@
#endif
#endif
-/* define printf formats for printing ptrdiff_t variables */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 &&
!defined(__svr4__) && !defined(WIN32) && !defined(__sgi) || defined(__hpux)
-#define PDFMT "%td"
-#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
-#define PDFMT "%d"
-#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
-#define PDFMT "%ld"
-#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG || SIZEOF_PTRDIFF_T ==
SIZEOF___INT64
-#define PDFMT LLFMT
-#else
-#error no definition for PDFMT
-#endif
-
-/* define printf format for printing pointer values */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
-#define PTRFMT "%p"
-#define PTRFMTCAST /* no cast needed */
-#elif defined(_MSC_VER)
-/* On Windows, always use 64 bit integers (even on 32-bit architectures)
- * to not get the warning C4311: 'type cast' : pointer truncation from
- * 'void *' to 'unsigned int' */
-#define PTRFMT "%I64x"
-#define PTRFMTCAST (unsigned __int64)
-#elif SIZEOF_VOID_P == SIZEOF_INT
-#define PTRFMT "%x"
-#define PTRFMTCAST (unsigned int)
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-#define PTRFMT "%lx"
-#define PTRFMTCAST (unsigned long)
-#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
-#define PTRFMT "%llx"
-#define PTRFMTCAST (unsigned long long)
-#else
-#error no definition for PTRFMT
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list