aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
diff options
context:
space:
mode:
authorDavid Edelsohn <dje@gcc.gnu.org>2013-05-04 10:49:59 -0400
committerDavid Edelsohn <dje@gcc.gnu.org>2013-05-04 10:49:59 -0400
commit0654e6be9566ff502a8754e3876c66dfdef14e2f (patch)
treefb2829d7008afaf98b795228050ea04dc0b30341 /fixincludes/inclhack.def
parent40de22d6f926dadb38c5b6cf46703843e3d2d1e7 (diff)
downloadgcc-0654e6be9566ff502a8754e3876c66dfdef14e2f.zip
gcc-0654e6be9566ff502a8754e3876c66dfdef14e2f.tar.gz
gcc-0654e6be9566ff502a8754e3876c66dfdef14e2f.tar.bz2
inclhack.def (aix_null): New.
* inclhack.def (aix_null): New. (void_null): Update replacement definition of NULL. * fixincl.x: Regenerate. * tests/base/curses.h: Update for new fix. From-SVN: r198596
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r--fixincludes/inclhack.def54
1 files changed, 42 insertions, 12 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 2406920..253df68 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 */";
};