diff -x configure -ru ../pgsql-master/config/c-compiler.m4 ./config/c-compiler.m4 --- ../pgsql-master/config/c-compiler.m4 Mon May 28 19:33:09 2001 +++ ./config/c-compiler.m4 Sat Dec 1 22:19:27 2001 @@ -117,3 +117,34 @@ undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ])# PGAC_CHECK_ALIGNOF + + +# PGAC_CHECK_TYPE(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES]) +# --------------------------------------------------------------------------- + +AC_DEFUN([PGAC_CHECK_TYPE], +[changequote(<<,>>)dnl +dnl The name to #define +define(<>, translit(have_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<>, translit(pgac_cv_have_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_CACHE_CHECK([for $1], AC_CV_NAME, +[AC_TRY_COMPILE([$4], +[if (($1 *) 0) + return 0; +if (sizeof ($1)) + return 0;], +AC_CV_NAME[=yes], +AC_CV_NAME[=no])]) +if test "$AC_CV_NAME" = yes; then + AC_DEFINE(AC_TYPE_NAME, 1, [Define to 1 if you have `]$1[']) + ifelse($2,,,[$2 +])[]dnl +ifelse($3,,,[else + $3 +])[]dnl +fi +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +])# PGAC_CHECK_TYPE diff -x configure -ru ../pgsql-master/configure.in ./configure.in --- ../pgsql-master/configure.in Sun Nov 25 23:20:29 2001 +++ ./configure.in Sat Dec 1 22:58:57 2001 @@ -1169,13 +1169,21 @@ fi AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any type]) + # Some platforms predefine the types int8, int16, etc. Only check -# a (hopefully) representative subset. Don't use AC_CHECK_TYPE, which -# doesn't work the way we want to. -AC_CHECK_SIZEOF(int8, 0) -AC_CHECK_SIZEOF(uint8, 0) -AC_CHECK_SIZEOF(int64, 0) -AC_CHECK_SIZEOF(uint64, 0) +# a (hopefully) representative subset. + +pgac_type_includes="\ +#include +#ifdef HAVE_SUPPORTDEFS_H +#include +#endif" + +PGAC_CHECK_TYPE(int8, [], [], [$pgac_type_includes]) +PGAC_CHECK_TYPE(uint8, [], [], [$pgac_type_includes]) +PGAC_CHECK_TYPE(int64, [], [], [$pgac_type_includes]) +PGAC_CHECK_TYPE(uint64, [], [], [$pgac_type_includes]) + PGAC_FUNC_POSIX_SIGNALS diff -x configure -ru ../pgsql-master/src/include/c.h ./src/include/c.h --- ../pgsql-master/src/include/c.h Fri Nov 16 17:41:40 2001 +++ ./src/include/c.h Sat Dec 1 22:35:05 2001 @@ -205,11 +205,11 @@ * used for numerical computations and the * frontend/backend protocol. */ -#if SIZEOF_INT8 == 0 +#ifndef HAVE_INT8 typedef signed char int8; /* == 8 bits */ typedef signed short int16; /* == 16 bits */ typedef signed int int32; /* == 32 bits */ -#endif /* SIZEOF_INT8 == 0 */ +#endif /* not HAVE_INT8 */ /* * uintN @@ -218,11 +218,11 @@ * frontend/backend protocol. */ /* Also defined in interfaces/odbc/md5.h */ -#if SIZEOF_UINT8 == 0 +#ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ -#endif /* SIZEOF_UINT8 == 0 */ +#endif /* not HAVE_UINT8 */ /* * boolN @@ -270,35 +270,37 @@ */ #ifdef HAVE_LONG_INT_64 /* Plain "long int" fits, use it */ -#if SIZEOF_INT64 == 0 + +#ifndef HAVE_INT64 typedef long int int64; #endif -#if SIZEOF_UINT64 == 0 +#ifndef HAVE_UINT64 typedef unsigned long int uint64; #endif -#else -#ifdef HAVE_LONG_LONG_INT_64 +#elif defined(HAVE_LONG_LONG_INT_64) /* We have working support for "long long int", use that */ -#if SIZEOF_INT64 == 0 + +#ifndef HAVE_INT64 typedef long long int int64; #endif -#if SIZEOF_UINT64 == 0 +#ifndef HAVE_UINT64 typedef unsigned long long int uint64; #endif -#else +#else /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */ + /* Won't actually work, but fall back to long int so that code compiles */ -#if SIZEOF_INT64 == 0 +#ifndef HAVE_INT64 typedef long int int64; #endif -#if SIZEOF_UINT64 == 0 +#ifndef HAVE_UINT64 typedef unsigned long int uint64; #endif #define INT64_IS_BUSTED -#endif -#endif + +#endif /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */ /* * Size diff -x configure -ru ../pgsql-master/src/include/pg_config.h.in ./src/include/pg_config.h.in --- ../pgsql-master/src/include/pg_config.h.in Fri Nov 16 17:41:40 2001 +++ ./src/include/pg_config.h.in Sat Dec 1 22:25:07 2001 @@ -697,10 +697,10 @@ /* Define if you have on_exit() */ #undef HAVE_ON_EXIT -#undef SIZEOF_INT8 -#undef SIZEOF_UINT8 -#undef SIZEOF_INT64 -#undef SIZEOF_UINT64 +#undef HAVE_INT8 +#undef HAVE_UINT8 +#undef HAVE_INT64 +#undef HAVE_UINT64 /* *------------------------------------------------------------------------ diff -x configure -ru ../pgsql-master/src/interfaces/odbc/md5.h ./src/interfaces/odbc/md5.h --- ../pgsql-master/src/interfaces/odbc/md5.h Wed Nov 28 22:10:11 2001 +++ ./src/interfaces/odbc/md5.h Sat Dec 1 22:43:57 2001 @@ -36,11 +36,11 @@ #endif /* __BEOS__ */ /* Also defined in include/c.h */ -#if SIZEOF_UINT8 == 0 +#ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ -#endif /* SIZEOF_UINT8 == 0 */ +#endif /* not HAVE_UINT8 */ extern bool md5_hash(const void *buff, size_t len, char *hexsum); extern bool EncryptMD5(const char *passwd, const char *salt,