This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add win32/win64 compatibility definitions to stddef.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]