From: "Benjamin C.R. LaHaise" <blah@xxxxxxxxx>
Subject: Re: ANSI C++ problem in include/linux/socket.h
Date: Wed, 10 Nov 1999 02:18:22 -0500 (EST)
> Wrong fix. The include files in 2.2.12+ are careful to define NULL as 0
> when compiling C++ code, so something else you are #include'ing is
> redefining NULL as ((void *)0) instead of the 0 it's supposed to be.
Thanks for pointing out that. I read and tested all the NULL
definitions, and then found that "include/linux/posix_types.h" was the
cause. The header unconditionally defines NULL as "(void *)0". So this
is a revised patch (I don't know where to send it, so I add Linus into
the addresses):
--- linux/include/linux/posix_types.h Mon Dec 28 15:18:28 1998
+++ /usr/src/linux/include/linux/posix_types.h Wed Nov 10 17:30:19 1999
@@ -8,7 +8,11 @@
*/
#ifndef NULL
-# define NULL ((void *) 0)
+# if !defined __cplusplus
+# define NULL ((void *) 0)
+# else
+# define NULL (0)
+# endif
#endif
/*
----------------------------------------------------------------------
OKUJI Yoshinori <okuji@xxxxxxxxxxxxxxxxxxx> ^o-o^
http://duff.kuicr.kyoto-u.ac.jp/~okuji (in English) m /
|