[Spread-users] Hi, here's a bug, and a patch.

Andrew Barnert Andrew.Barnert at teneros.com
Wed May 3 15:46:27 EDT 2006


Hi there. I tried to send this a few days ago, but because of a glitch
with our server, my mail to the list went out with a different address
than my confirmation message, so it got bounced. Hopefully it's all
fixed and you're reading this.

Anyway, I found a bug in spread-3.17.3. Spread's C/C++ interface defines
NULL as (void *)0, which is perfectly fine for C, but not for C++.

The result is that if you include sp.h before including any of the
standard headers that define NULL, some compilers (including MSVC8, but
not MSVC7.1 or gcc 3.x) will spew out tons of errors.

Personally, I think it's a bit silly to include sp.h before any of the
standard headers. But obviously someone wanted it to work that way, or
they wouldn't have defined NULL in the first place.

Also, is a 3.17.4 (or 3.18) release intended (hopefully with this
patch)? Because I don't think we're ready to move to 4.0 as soon as it
comes out.

Thanks.

License follows, then the patch. (If you're curious why the patch
removes the old #define and then adds the exact same line back, ask
Perforce....)

Copyright (C) 2006 Teneros, Inc.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
    
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

--- //depot/svn/dev-vs2005/src/3rdparty/include/sp_events.h
2006/04/27 16:46:21
+++ //depot/svn/dev-vs2005/src/3rdparty/include/sp_events.h
2006/04/28 16:47:53
@@ -67,7 +67,11 @@
 } sp_time;
 
 #ifndef NULL
-#define NULL    (void *)0
+#ifdef __cplusplus
+#define NULL    0
+#else
+#define NULL    (void *)0
+#endif
 #endif
 
 /* Event routines */







More information about the Spread-users mailing list