From 4944d4df46e31275173c5d559792d21b5839a5cd Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Tue, 21 Sep 1999 23:55:19 +0000 Subject: [PATCH] define NULL as (0L) if __cplusplus is defined, to avoid "ANSI C++ forbids Wed Sep 22 01:53:18 1999 Tim Janik * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to avoid "ANSI C++ forbids implicit conversion from `void *' in argument passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack for erroring out on this, instead of just issueing a warning). * glib.h (g_trash_stack_pop): use uncasted NULL again. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-0 | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-12 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ glib.h | 10 +++++++--- glib/glib.h | 10 +++++++--- 10 files changed, 86 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08bca22a2..0962bd9da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 08bca22a2..0962bd9da 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Wed Sep 22 01:53:18 1999 Tim Janik + + * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to + avoid "ANSI C++ forbids implicit conversion from `void *' in argument + passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack + for erroring out on this, instead of just issueing a warning). + + * glib.h (g_trash_stack_pop): use uncasted NULL again. + Fri Sep 17 10:24:45 1999 Tim Janik * gmem.c (g_mem_chunk_compute_size) (g_mem_chunk_new): applied patch diff --git a/glib.h b/glib.h index b85bec258..41b9477f2 100644 --- a/glib.h +++ b/glib.h @@ -103,8 +103,12 @@ extern "C" { * been defined. It is assumed that if they are already * defined then the current definition is correct. */ -#ifndef NULL -#define NULL ((void*) 0) +#ifndef NULL +# ifdef __cplusplus +# define NULL (0L) +# else /* !__cplusplus */ +# define NULL ((void*) 0) +# endif /* !__cplusplus */ #endif #ifndef FALSE @@ -1690,7 +1694,7 @@ g_trash_stack_pop (GTrashStack **stack_p) /* NULLify private pointer here, most platforms store NULL as * subsequent 0 bytes */ - data->next = (GTrashStack*) NULL; + data->next = NULL; } return data; diff --git a/glib/glib.h b/glib/glib.h index b85bec258..41b9477f2 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -103,8 +103,12 @@ extern "C" { * been defined. It is assumed that if they are already * defined then the current definition is correct. */ -#ifndef NULL -#define NULL ((void*) 0) +#ifndef NULL +# ifdef __cplusplus +# define NULL (0L) +# else /* !__cplusplus */ +# define NULL ((void*) 0) +# endif /* !__cplusplus */ #endif #ifndef FALSE @@ -1690,7 +1694,7 @@ g_trash_stack_pop (GTrashStack **stack_p) /* NULLify private pointer here, most platforms store NULL as * subsequent 0 bytes */ - data->next = (GTrashStack*) NULL; + data->next = NULL; } return data;