This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add win32/win64 compatibility definitions to stddef.h
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ozkan Sezer <sezeroz at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kai Tietz <ktietz70 at googlemail dot com>
- Date: Mon, 24 Aug 2009 12:47:48 +0000 (UTC)
- Subject: Re: [PATCH] Add win32/win64 compatibility definitions to stddef.h
- References: <647fe9b10908240509s136e93cfh4dff26f9936f600f@mail.gmail.com>
On Mon, 24 Aug 2009, Ozkan Sezer wrote:
> The following patch adds _WIN32/_WIN64 compatibility
> definitions to gcc's stddef.h. OK for trunk and the
> 4.4 branch? (Note: I don't have write access.)
This patch makes no sense - GCC always defines the macros __PTRDIFF_TYPE__
etc. so instead we should *remove* the existing #ifndef cases for those
rather than adding more special cases that will always be dead code.
> #if defined (_STDDEF_H) || defined (__need_NULL)
> #undef NULL /* in case <stdio.h> has defined it. */
> -#ifdef __GNUG__
> +#if defined(__GNUG__) && __GNUG__ >= 3
stddef.h must always be used with the matching GCC version so this also
makes no sense. Again, the code should be simplified: __null if C++,
((void *)0) otherwise, no cases for non-GNU C++ or special cases for any
target.
--
Joseph S. Myers
joseph@codesourcery.com