PATCH: libdecimal builts with types.h using __(xxx)_t_defined clauses

Kai Tietz Kai.Tietz@onevision.com
Thu Mar 1 13:26:00 GMT 2007


Hi,

while porting I ran over the problem, that the types.h header causes 
problem while building libdecimal, if the types headers uses older 
__(xxx)_t_defined clauses.
I suggest this patch

ChangLog entry:

2007-03-01  Kai Tietz   <kai.tietz@onevision.com>

        * config/stdint.m4: Make template compatible with older cygwin 
types.h (for __(xxx)_t_defined clauses),...)

Patch:

Index: config/stdint.m4
===================================================================
--- config/stdint.m4    (revision 122428)
+++ config/stdint.m4    (working copy)
@@ -218,33 +218,45 @@
 
     #ifndef _UINT8_T
     #define _UINT8_T
+    #ifndef __uint8_t_defined
     typedef unsigned $acx_cv_type_int8_t uint8_t;
     #endif
+    #endif
 
     #ifndef _UINT16_T
     #define _UINT16_T
+    #ifndef __uint16_t_defined
     typedef unsigned $acx_cv_type_int16_t uint16_t;
     #endif
+    #endif
 
     #ifndef _UINT32_T
     #define _UINT32_T
+    #ifndef __uint32_t_defined
     typedef unsigned $acx_cv_type_int32_t uint32_t;
     #endif
+    #endif
 
     #ifndef _INT8_T
     #define _INT8_T
+    #ifndef __int8_t_defined
     typedef $acx_cv_type_int8_t int8_t;
     #endif
+    #endif
 
     #ifndef _INT16_T
     #define _INT16_T
+    #ifndef __int16_t_defined
     typedef $acx_cv_type_int16_t int16_t;
     #endif
+    #endif
 
     #ifndef _INT32_T
     #define _INT32_T
+    #ifndef __int32_t_defined
     typedef $acx_cv_type_int32_t int32_t;
     #endif
+    #endif
 EOF
 elif test "$ac_cv_type_u_int32_t" = yes; then
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -262,18 +274,24 @@
 
     #ifndef _UINT8_T
     #define _UINT8_T
+    #ifndef __uint8_t_defined
     typedef u_int8_t uint8_t;
     #endif
+    #endif
 
     #ifndef _UINT16_T
     #define _UINT16_T
+    #ifndef __uint16_t_defined
     typedef u_int16_t uint16_t;
     #endif
+    #endif
 
     #ifndef _UINT32_T
     #define _UINT32_T
+    #ifndef __uint32_t_defined
     typedef u_int32_t uint32_t;
     #endif
+    #endif
 EOF
 else
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -321,8 +339,10 @@
     #endif
     #ifndef _UINT64_T
     #define _UINT64_T
+    #ifndef __uint8_t_defined
     typedef u_int64_t uint64_t;
     #endif
+    #endif
 EOF
 elif test -n "$acx_cv_type_int64_t"; then
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -334,8 +354,10 @@
     #endif
     #ifndef _UINT64_T
     #define _UINT64_T
+    #ifndef __uint8_t_defined
     typedef unsigned $acx_cv_type_int64_t uint64_t;
     #endif
+    #endif
 EOF
 else
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -344,10 +366,13 @@
     #if defined __STDC_VERSION__ && (__STDC_VERSION__-0) >= 199901L
     #ifndef _INT64_T
     #define _INT64_T
+    #ifndef __uint8_t_defined
     typedef long long int64_t;
     #endif
+    #endif
     #ifndef _UINT64_T
     #define _UINT64_T
     typedef unsigned long long uint64_t;
@@ -390,8 +415,12 @@
   sed 's/^ *//' >> tmp-stdint.h <<EOF
 
     /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */
+    #ifndef __uintptr_t_defined
     typedef u$acx_cv_type_intptr_t uintptr_t;
+    #endif
+    #ifndef __intptr_t_defined
     typedef $acx_cv_type_intptr_t  intptr_t;
+    #endif
 EOF
 fi
 

Regards,
 i.A. Kai Tietz

----------------------------------------
  Kai Tietz - Software engineering
  OneVision Software Entwicklungs GmbH & Co KG
  Dr.-Leo-Ritter-Str. 9, 93049 Regensburg, Germany
  Phone: +49-941-78004-0
  FAX:   +49-941-78004-489
  WWW:   http://www.OneVision.com



More information about the Gcc-patches mailing list