public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch for mingw stdint information
@ 2009-04-03 20:24 FX
  2009-04-04  8:38 ` Danny Smith
  2009-04-08  0:43 ` Joseph S. Myers
  0 siblings, 2 replies; 5+ messages in thread
From: FX @ 2009-04-03 20:24 UTC (permalink / raw)
  To: dannysmith, kai.tietz, nightstrike; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

Hi all,

Please find attached a patch I built to add stdint-related information  
to GCC configuration for the mingw target (see http://gcc.gnu.org/ml/gcc/2009-04/msg00000.html 
  for more details about why). I built it from looking at the mingw  
headers, because I have them on my laptop, I'm in a hotel room far  
from home and I can get to sleep :)  I've not done (and will not do in  
the foreseeable future) any testing, so they'll need to be  
bootstrapped and regtest on at least the gcc.dg/c99-stdint-*.c tests.  
If you find failures of c99-stdint-1.c, it means the mingw headers  
need fixing (I'm particularly worried about int_fast8_t, which is  
"char" rather than "signed char", and I suspect this could spell  
trouble).

I hope this can help,
FX


[-- Attachment #2: mingw-stdint.diff --]
[-- Type: application/octet-stream, Size: 2250 bytes --]

diff -pru trunk.unmodified/gcc/config/i386/mingw32.h trunk/gcc/config/i386/mingw32.h
--- trunk.unmodified/gcc/config/i386/mingw32.h	2009-04-03 10:48:59.000000000 +0530
+++ trunk/gcc/config/i386/mingw32.h	2009-04-04 01:40:08.000000000 +0530
@@ -155,6 +155,45 @@ do {						         \
 #undef WINT_TYPE
 #define WINT_TYPE "short unsigned int"
 
+/* Types from stdint.h.  */
+#define INT8_TYPE "signed char"
+#define INT16_TYPE "short int"
+#define INT32_TYPE "int"
+#define INT64_TYPE "long long int"
+#define UINT8_TYPE "unsigned char"
+#define UINT16_TYPE "short unsigned int"
+#define UINT32_TYPE "unsigned int"
+#define UINT64_TYPE "long long unsigned int"
+
+#define INT_LEAST8_TYPE "signed char"
+#define INT_LEAST16_TYPE "short int"
+#define INT_LEAST32_TYPE "int"
+#define INT_LEAST64_TYPE "long long int"
+#define UINT_LEAST8_TYPE "unsigned char"
+#define UINT_LEAST16_TYPE "short unsigned int"
+#define UINT_LEAST32_TYPE "unsigned int"
+#define UINT_LEAST64_TYPE "long long unsigned int"
+
+/* INT_FAST8_TYPE being "char" instead of "signed char" is weird.  */
+#define INT_FAST8_TYPE "char"
+#define INT_FAST16_TYPE "short int"
+#define INT_FAST32_TYPE "int"
+#define INT_FAST64_TYPE "long long int"
+#define UINT_FAST8_TYPE "unsigned char"
+#define UINT_FAST16_TYPE "short unsigned int"
+#define UINT_FAST32_TYPE "unsigned int"
+#define UINT_FAST64_TYPE "long long unsigned int"
+
+#if TARGET_64BIT_DEFAULT
+#define INTPTR_TYPE "long long int"
+#define UINTPTR_TYPE "long long unsigned int"
+#else
+#define INTPTR_TYPE "int"
+#define UINTPTR_TYPE "unsigned int"
+#endif
+
+#define SIG_ATOMIC_TYPE "int"
+
 /* mingw32 uses the  -mthreads option to enable thread support.  */
 #undef GOMP_SELF_SPECS
 #define GOMP_SELF_SPECS "%{fopenmp: -mthreads}"
diff -pru trunk.unmodified/gcc/config.gcc trunk/gcc/config.gcc
--- trunk.unmodified/gcc/config.gcc	2009-04-03 10:49:00.000000000 +0530
+++ trunk/gcc/config.gcc	2009-04-04 01:35:47.000000000 +0530
@@ -1265,6 +1265,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
 	c_target_objs="${c_target_objs} msformat-c.o"
 	cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
 	default_use_cxa_atexit=yes
+	use_gcc_stdint=wrap
 	case ${enable_threads} in
 	  "" | yes | win32)
 	  thread_file='win32'

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-08  0:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-03 20:24 Patch for mingw stdint information FX
2009-04-04  8:38 ` Danny Smith
2009-04-04  9:22   ` Kai Tietz
2009-04-04 13:00     ` Dave Korn
2009-04-08  0:43 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).