diff options
author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-04 14:49:59 +0000 |
---|---|---|
committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-04 14:49:59 +0000 |
commit | 3c47853b2d46494c8a017b0ffcc3684d896cd713 (patch) | |
tree | fb2829d7008afaf98b795228050ea04dc0b30341 /fixincludes/inclhack.def | |
parent | fd304a932522a0d854fbe316429753f001e5b7de (diff) | |
download | gcc-3c47853b2d46494c8a017b0ffcc3684d896cd713.tar.gz |
* inclhack.def (aix_null): New.
(void_null): Update replacement definition of NULL.
* fixincl.x: Regenerate.
* tests/base/curses.h: Update for new fix.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198596 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 24069201d12..253df68997c 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -617,6 +617,33 @@ fix = { }; /* + * Fix AIX definition of NULL for G++. + */ +fix = { + hackname = aix_null; + mach = "*-*-aix*"; + files = curses.h, dbm.h, locale.h, stdio.h, stdlib.h, string.h, + time.h, unistd.h, wchar.h, sys/dir.h, sys/param.h, sys/types.h; + bypass = __null; + select = "#define[ \t]+NULL[ \t]+\\(*0L*\\)*"; + c_fix = format; + c_fix_arg = <<- _EOFix_ + #ifndef NULL + #ifdef __cplusplus + #ifdef __GNUG__ + #define NULL __null + #else /* ! __GNUG__ */ + #define NULL 0L + #endif /* __GNUG__ */ + #else /* ! __cplusplus */ + #define NULL ((void *)0) + #endif /* __cplusplus */ + #endif /* !NULL */ + _EOFix_; + test_text = "# define\tNULL \t(0L) /* typed NULL */"; +}; + +/* * pthread.h on AIX defines PTHREAD_ONCE_INIT, PTHREAD_MUTEX_INITIALIZER, * PTHREAD_COND_INITIALIZER and PTHREAD_RWLOCK_INITIALIZER without enough * braces. @@ -4552,23 +4579,26 @@ fix = { */ fix = { hackname = void_null; - files = curses.h; - files = dbm.h; - files = locale.h; - files = stdio.h; - files = stdlib.h; - files = string.h; - files = time.h; - files = unistd.h; - files = sys/dir.h; - files = sys/param.h; - files = sys/types.h; + files = curses.h, dbm.h, locale.h, stdio.h, stdlib.h, string.h, + time.h, unistd.h, sys/dir.h, sys/param.h, sys/types.h; /* avoid changing C++ friendly NULL */ bypass = __cplusplus; bypass = __null; select = "^#[ \t]*define[ \t]+NULL[ \t]+\\(\\(void[ \t]*\\*\\)0\\)"; c_fix = format; - c_fix_arg = "#define NULL 0"; + c_fix_arg = <<- _EOFix_ + #ifndef NULL + #ifdef __cplusplus + #ifdef __GNUG__ + #define NULL __null + #else /* ! __GNUG__ */ + #define NULL 0L + #endif /* __GNUG__ */ + #else /* ! __cplusplus */ + #define NULL ((void *)0) + #endif /* __cplusplus */ + #endif /* !NULL */ + _EOFix_; test_text = "# define\tNULL \t((void *)0) /* typed NULL */"; }; |