This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix Solaris 9 stdint.h
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: bkorb at gnu dot org
- Date: Fri, 3 Jul 2009 19:58:44 +0200
- Subject: [PATCH] Fix Solaris 9 stdint.h
Hi,
this patch fixes the stdint.h implementation on Solaris 9, as per Joseph's
recommendations: http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02417.html
Tested on sparc-sun-solaris2.9, OK for mainline?
2009-07-03 Eric Botcazou <ebotcazou@adacore.com>
* inclhack.def (solaris_int_types): New fix.
* fixincl.x: Regenerate.
* tests/base/sys/int_types.h: New file.
--
Eric Botcazou
Index: inclhack.def
===================================================================
--- inclhack.def (revision 149204)
+++ inclhack.def (working copy)
@@ -3331,7 +3331,29 @@ fix = {
/*
- * Solaris 2.8 has what appears to be some gross workaround for
+ * Sun Solaris up to 9 has a version of sys/int_types.h that forbids use
+ * of standard 64-bit types with C99 in 32-bit mode.
+ */
+fix = {
+ hackname = solaris_int_types;
+ select = "__STDC__ - 0 == 0";
+ bypass = "_LONGLONG_TYPE";
+ files = sys/int_types.h;
+ c_fix = format;
+ c_fix_arg =
+ "(defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__))";
+ test_text =
+ "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
+ "typedef long long int64_t;\n"
+ "#endif\n\n"
+ "#if defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG))\n"
+ "typedef int64_t intmax_t;\n"
+ "#endif";
+};
+
+
+/*
+ * Sun Solaris 8 has what appears to be some gross workaround for
* some old version of their c++ compiler. G++ doesn't want it
* either, but doesn't want to be tied to SunPRO version numbers.
*/
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/sys/int_types.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( SOLARIS_INT_TYPES_CHECK )
#if (defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__)) && !defined(_NO_LONGLONG)
typedef long long int64_t;
#endif
#if defined(_LP64) || ((defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__)) && !defined(_NO_LONGLONG))
typedef int64_t intmax_t;
#endif
#endif /* SOLARIS_INT_TYPES_CHECK */