include/linux/posix_types.h

Andrew Pollard (andrew@odie.demon.co.uk)
Fri, 9 Jan 1998 12:28:01 GMT


Hi,

Is there a 'good' reason why include/linux/posix_types.h in 2.0.33
and 2.1.78 defines NULL in the way it does?

#ifndef NULL
# define NULL ((void *) 0)
#endif

and not the way that libio.h in libc5.4.42 does

#ifndef NULL
# if defined __GNUG__ && \
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
# define NULL (__null)
# else
# if !defined(__cplusplus)
# define NULL ((void*)0)
# else
# define NULL (0)
# endif
# endif
#endif

This causes some problems with the latest egcs compilers and using
c++, since the (void*)0 form is now not standard C++. Depending on the
order you include things, you may get the posix_types definition or
the libio one.

(you get warnings in the iostream.h headers, etc).

Andrew.

--
   Andrew Pollard, Auto Simulations Ltd. UK.    | home: andrew@odie.demon.co.uk
   2 Milbanke Court, Milbanke Way, Bracknell    | work: andrewp@autosim.com
Tel:+44(0)1344 426486x103 Fax:+44(0)1344 426615 | http://www.odie.demon.co.uk