From: Kai Tietz <ktietz70@googlemail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
Richard Henderson <rth@redhat.com>
Subject: [patch]: Add check for stdint header
Date: Wed, 02 Sep 2009 22:18:00 -0000 [thread overview]
Message-ID: <90baa01f0909021518w469a8991ga54bacf8f7df68f9@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Hello,
this patch adds to gcc's system.h file the include of stdint.h file,
if present. If it doesn't finds this header it defines uintptr_t as
'unsigned long' and intptr_t as 'long'.
ChangeLog
2009-09-03 Kai Tietz <kai.tietz@onevision.com>
* config.in (HAVE_STDINT_H): New.
* configure.ac (AC_CHECK_HEADERS): Add stdint.h.
* configure: Regenerated.
* system.h: Include stdint.h, if present. Or define default
versions of uintptr_t and intptr_t with long type.
Tested for x86_64-pc-linux, i686-w64-mingw32, and for
x86_64-w64-mingw32. Ok for apply to trunk?
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
[-- Attachment #2: stdint.diff --]
[-- Type: application/octet-stream, Size: 8192 bytes --]
Index: gcc/gcc/config.in
===================================================================
--- gcc.orig/gcc/config.in 2009-08-24 08:11:35.000000000 +0200
+++ gcc/gcc/config.in 2009-09-03 00:01:22.464371000 +0200
@@ -1144,6 +1144,9 @@
#undef HAVE_MALLOC_H
#endif
+#ifndef USED_FOR_TARGET
+#undef HAVE_STDINT_H
+#endif
/* Define to 1 if you have the `mbstowcs' function. */
#ifndef USED_FOR_TARGET
Index: gcc/gcc/configure.ac
===================================================================
--- gcc.orig/gcc/configure.ac 2009-08-28 21:28:51.000000000 +0200
+++ gcc/gcc/configure.ac 2009-09-03 00:02:42.309371000 +0200
@@ -933,7 +933,8 @@
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
- direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
+ direct.h malloc.h stdint.h langinfo.h ldfcn.h \
+ locale.h wchar.h)
# Check for thread headers.
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
Index: gcc/gcc/system.h
===================================================================
--- gcc.orig/gcc/system.h 2009-08-27 15:04:09.000000000 +0200
+++ gcc/gcc/system.h 2009-09-03 00:06:55.908371000 +0200
@@ -414,6 +414,13 @@
extern void *realloc (void *, size_t);
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+#define uintptr_t unsigned long
+#define intptr_t long
+#endif
+
/* If the system doesn't provide strsignal, we get it defined in
libiberty but no declaration is supplied. */
#if !defined (HAVE_STRSIGNAL) \
Index: gcc/gcc/configure
===================================================================
--- gcc.orig/gcc/configure 2009-08-28 21:28:51.000000000 +0200
+++ gcc/gcc/configure 2009-09-03 00:13:07.396371000 +0200
@@ -7492,7 +7492,8 @@
for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
- direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
+ direct.h malloc.h stdint.h langinfo.h ldfcn.h \
+ locale.h wchar.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header"
@@ -11078,13 +11079,13 @@
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:11081: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:11082: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:11084: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:11085: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:11087: output\"" >&5)
+ (eval echo "\"\$as_me:11088: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -12289,7 +12290,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 12292 "configure"' > conftest.$ac_ext
+ echo '#line 12293 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -13949,11 +13950,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13952: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13953: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13956: \$? = $ac_status" >&5
+ echo "$as_me:13957: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14288,11 +14289,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14291: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14292: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14295: \$? = $ac_status" >&5
+ echo "$as_me:14296: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14393,11 +14394,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14396: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14397: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14400: \$? = $ac_status" >&5
+ echo "$as_me:14401: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14448,11 +14449,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14451: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14452: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14455: \$? = $ac_status" >&5
+ echo "$as_me:14456: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16830,7 +16831,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 16833 "configure"
+#line 16834 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16926,7 +16927,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 16929 "configure"
+#line 16930 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18882,11 +18883,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18885: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18886: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18889: \$? = $ac_status" >&5
+ echo "$as_me:18890: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -18981,11 +18982,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18984: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18985: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18988: \$? = $ac_status" >&5
+ echo "$as_me:18989: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19033,11 +19034,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19036: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19037: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19040: \$? = $ac_status" >&5
+ echo "$as_me:19041: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
next reply other threads:[~2009-09-02 22:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-02 22:18 Kai Tietz [this message]
2009-09-03 1:37 ` Kai Tietz
2009-09-03 10:55 ` Richard Guenther
2009-09-03 11:05 ` Kai Tietz
2009-09-03 11:10 ` Richard Guenther
2009-09-04 7:49 ` Kai Tietz
2009-09-04 9:57 ` Richard Guenther
2009-09-04 10:36 ` Paolo Bonzini
[not found] ` <4AA0EE5E.80204@gnu.org>
[not found] ` <90baa01f0909040359r45b5b0c1gfb9132cf800bde9b@mail.gmail.com>
[not found] ` <90baa01f0909040534g4ac57551se2e843b861c42a06@mail.gmail.com>
2009-09-04 13:22 ` Paolo Bonzini
2009-09-06 9:57 ` Ralf Wildenhues
2009-09-04 12:48 Tobias Burnus
2009-09-04 12:53 ` Kai Tietz
2009-09-04 13:18 ` Tobias Burnus
2009-09-04 13:27 ` Paolo Bonzini
2009-09-04 14:07 ` Kai Tietz
2009-09-05 12:41 ` Paolo Bonzini
2009-09-08 15:22 ` Kai Tietz
2009-09-06 10:00 ` Ralf Wildenhues
2009-09-07 6:51 ` Paolo Bonzini
2009-09-04 13:07 Tobias Burnus
2009-09-04 13:18 ` Kai Tietz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90baa01f0909021518w469a8991ga54bacf8f7df68f9@mail.gmail.com \
--to=ktietz70@googlemail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).