pg_config_h.patch   [plain text]


--- pg_config.h.orig	2010-09-22 10:29:59.000000000 -0700
+++ pg_config.h	2010-09-22 11:59:47.000000000 -0700
@@ -17,16 +17,34 @@
 #define AC_APPLE_UNIVERSAL_BUILD 1
 
 /* The normal alignment of `double', in bytes. */
-#define ALIGNOF_DOUBLE 8
+#if defined (__LP64__)
+  #define ALIGNOF_DOUBLE 8
+#else
+  #define ALIGNOF_DOUBLE 4
+#endif
 
 /* The normal alignment of `int', in bytes. */
-#define ALIGNOF_INT 4
+#if defined (__LP64__)
+  #define ALIGNOF_INT 8
+#else
+  #define ALIGNOF_INT 4
+#endif
 
 /* The normal alignment of `long', in bytes. */
-#define ALIGNOF_LONG 8
+
+#if defined (__LP64__)
+  #define ALIGNOF_LONG 8
+#else
+  #define ALIGNOF_LONG 4
+#endif
 
 /* The normal alignment of `long long int', in bytes. */
 /* #undef ALIGNOF_LONG_LONG_INT */
+#if defined (__LP64__)
+  /* #undef ALIGNOF_LONG_LONG_INT */
+#else
+  #define ALIGNOF_LONG_LONG_INT 4
+#endif
 
 /* The normal alignment of `short', in bytes. */
 #define ALIGNOF_SHORT 2
@@ -67,7 +85,11 @@
 
 /* float8, int8, and related values are passed by value if 'true', by
    reference if 'false' */
-#define FLOAT8PASSBYVAL true
+#if defined (__LP64__)
+  #define FLOAT8PASSBYVAL true
+#else
+  #define FLOAT8PASSBYVAL false
+#endif
 
 /* Define to 1 if getpwuid_r() takes a 5th argument. */
 #define GETPWUID_R_5ARG /**/
@@ -326,16 +348,28 @@
 
 /* Define to 1 if constants of type 'long long int' should have the suffix LL.
    */
-/* #undef HAVE_LL_CONSTANTS */
+#if defined (__LP64__)
+  /* #undef HAVE_LL_CONSTANTS */
+#else
+  #define HAVE_LL_CONSTANTS 1
+#endif
 
 /* Define to 1 if `long int' works and is 64 bits. */
-#define HAVE_LONG_INT_64 1
+#if defined (__LP64__)
+  #define HAVE_LONG_INT_64 1
+#else
+  /* #undef HAVE_LONG_INT_64 */
+#endif
 
 /* Define to 1 if the system has the type `long long int'. */
 #define HAVE_LONG_LONG_INT 1
 
 /* Define to 1 if `long long int' works and is 64 bits. */
-/* #undef HAVE_LONG_LONG_INT_64 */
+#if defined (__LP64__)
+  /* #undef HAVE_LONG_LONG_INT_64 */
+#else
+  #define HAVE_LONG_LONG_INT_64 1
+#endif
 
 /* Define to 1 if you have the `memmove' function. */
 #define HAVE_MEMMOVE 1
@@ -655,13 +689,21 @@
 /* #undef HAVE_WINLDAP_H */
 
 /* Define to the appropriate snprintf format for 64-bit ints. */
-#define INT64_FORMAT "%ld"
+#if defined (__LP64__)
+  #define INT64_FORMAT "%ld"
+#else
+  #define INT64_FORMAT "%lld"
+#endif
 
 /* Define to build with Kerberos 5 support. (--with-krb5) */
 #define KRB5 1
 
 /* Define as the maximum alignment requirement of any C data type. */
-#define MAXIMUM_ALIGNOF 8
+#if defined (__LP64__)
+  #define MAXIMUM_ALIGNOF 8
+#else
+  #define MAXIMUM_ALIGNOF 4
+#endif
 
 /* Define bytes to use libc memset(). */
 #define MEMSET_LOOP_LIMIT 1024
@@ -725,10 +767,18 @@
 #define SIZEOF_OFF_T 8
 
 /* The size of `size_t', as computed by sizeof. */
-#define SIZEOF_SIZE_T 8
+#if defined (__LP64__)
+  #define SIZEOF_SIZE_T 8
+#else
+  #define SIZEOF_SIZE_T 4
+#endif
 
 /* The size of `void *', as computed by sizeof. */
-#define SIZEOF_VOID_P 8
+#if defined (__LP64__)
+  #define SIZEOF_VOID_P 8
+#else
+  #define SIZEOF_VOID_P 4
+#endif
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -740,7 +790,11 @@
 /* #undef TM_IN_SYS_TIME */
 
 /* Define to the appropriate snprintf format for unsigned 64-bit ints. */
-#define UINT64_FORMAT "%lu"
+#if defined (__LP64__)
+  #define UINT64_FORMAT "%lu"
+#else
+  #define UINT64_FORMAT "%llu"
+#endif
 
 /* Define to 1 to build with assertion checks. (--enable-cassert) */
 /* #undef USE_ASSERT_CHECKING */
@@ -754,7 +808,11 @@
 
 /* Define to 1 if you want float8, int8, etc values to be passed by value.
    (--enable-float8-byval) */
-#define USE_FLOAT8_BYVAL 1
+#if defined (__LP64__)
+  #define USE_FLOAT8_BYVAL 1
+#else
+  /* #undef USE_FLOAT8_BYVAL */
+#endif
 
 /* Define to 1 if "static inline" works without unwanted warnings from
    compilations where static inline functions are defined but not called. */