diff mbox

Fix cygwin-stdint.h

Message ID 53EA7240.9020809@redhat.com
State New
Headers show

Commit Message

Yaakov Selkowitz Aug. 12, 2014, 8 p.m. UTC
This patch fixes an error in r197168 where type definitions were made 
dependent on the host architecture instead of the target.  This causes
cross-compilation issues, particularly in a --host=x86_64-* 
--target=i686-pc-cygwin configuration.

Attached patch was tested by comparing output of './gcc/xgcc -B ./gcc 
-dM -E - </dev/null' between native and cross compilers for each of the 
Cygwin targets.

Comments

Kai Tietz Aug. 12, 2014, 9:40 p.m. UTC | #1
2014-08-12 22:00 GMT+02:00 Yaakov Selkowitz <yselkowi@redhat.com>:
> This patch fixes an error in r197168 where type definitions were made
> dependent on the host architecture instead of the target.  This causes
> cross-compilation issues, particularly in a --host=x86_64-*
> --target=i686-pc-cygwin configuration.
>
> Attached patch was tested by comparing output of './gcc/xgcc -B ./gcc -dM -E
> - </dev/null' between native and cross compilers for each of the Cygwin
> targets.
>
> --
> Yaakov Selkowitz
> Associate Software Engineer, ARM
> Red Hat, Inc.

Patch is ok. I will apply it tomorrow along with the other two patches of you.

Thanks,
Kai
Kai Tietz Aug. 19, 2014, 2:59 p.m. UTC | #2
Applied for you at revision 214156.

Kai
diff mbox

Patch

Index: gcc/config/i386/cygwin-stdint.h
===================================================================
--- gcc/config/i386/cygwin-stdint.h	(revision 213874)
+++ gcc/config/i386/cygwin-stdint.h	(working copy)
@@ -24,20 +24,12 @@ 
 #define INT8_TYPE "signed char"
 #define INT16_TYPE "short int"
 #define INT32_TYPE "int"
-#ifdef __x86_64__
-#define INT64_TYPE "long int"
-#else
-#define INT64_TYPE "long long int"
-#endif
+#define INT64_TYPE (TARGET_64BIT ? "long int" : "long long int")
 
 #define UINT8_TYPE "unsigned char"
 #define UINT16_TYPE "short unsigned int"
 #define UINT32_TYPE "unsigned int"
-#ifdef __x86_64__
-#define UINT64_TYPE "long unsigned int"
-#else
-#define UINT64_TYPE "long long unsigned int"
-#endif
+#define UINT64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
 
 /* Minimum-width integer types */
 
@@ -44,51 +36,26 @@ 
 #define INT_LEAST8_TYPE "signed char"
 #define INT_LEAST16_TYPE "short int"
 #define INT_LEAST32_TYPE "int"
-#ifdef __x86_64__
-#define INT_LEAST64_TYPE "long int"
-#else
-#define INT_LEAST64_TYPE "long long int"
-#endif
+#define INT_LEAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
 
 #define UINT_LEAST8_TYPE "unsigned char"
 #define UINT_LEAST16_TYPE "short unsigned int"
 #define UINT_LEAST32_TYPE "unsigned int"
-#ifdef __x86_64__
-#define UINT_LEAST64_TYPE "long unsigned int"
-#else
-#define UINT_LEAST64_TYPE "long long unsigned int"
-#endif
+#define UINT_LEAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
 
 /* Fastest minimum-width integer types */
 
 #define INT_FAST8_TYPE "signed char"
-#ifdef __x86_64__
-#define INT_FAST16_TYPE "long int"
-#define INT_FAST32_TYPE "long int"
-#define INT_FAST64_TYPE "long int"
-#else
-#define INT_FAST16_TYPE "int"
-#define INT_FAST32_TYPE "int"
-#define INT_FAST64_TYPE "long long int"
-#endif
+#define INT_FAST16_TYPE (TARGET_64BIT ? "long int" : "int")
+#define INT_FAST32_TYPE (TARGET_64BIT ? "long int" : "int")
+#define INT_FAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
 
 #define UINT_FAST8_TYPE "unsigned char"
-#ifdef __x86_64__
-#define UINT_FAST16_TYPE "long unsigned int"
-#define UINT_FAST32_TYPE "long unsigned int"
-#define UINT_FAST64_TYPE "long unsigned int"
-#else
-#define UINT_FAST16_TYPE "unsigned int"
-#define UINT_FAST32_TYPE "unsigned int"
-#define UINT_FAST64_TYPE "long long unsigned int"
-#endif
+#define UINT_FAST16_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
+#define UINT_FAST32_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
+#define UINT_FAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
 
 /* Integer types capable of holding object pointers */
 
-#ifdef __x86_64__
-#define INTPTR_TYPE "long int"
-#define UINTPTR_TYPE "long unsigned int"
-#else
-#define INTPTR_TYPE "int"
-#define UINTPTR_TYPE "unsigned int"
-#endif
+#define INTPTR_TYPE (TARGET_64BIT ? "long int" : "int")
+#define UINTPTR_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")