diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-07-12 13:45:07 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-07-19 10:59:22 +0800 |
commit | 368a9c7c61f8144eca48b12c5aac82b6a1d8c6bf (patch) | |
tree | c915a09b4dbe4c2fa5e95f5ecb48458d29152c16 | |
parent | e87035c17b23dc6cca2eea2b0ff9223314bb55ea (diff) |
Undefine NULL before defining it to 0 on FreeBSD
Since C++11, NULL is promoted to nullptr on some BSD platforms. This is
very problematic when used with Boost. At times it would fail during
compile-time. What's worse is if it passes compile-time, but then crash
during run-time, for example when some condition is to be checked for its
truth, when then it would be compared to a nullptr.
-rw-r--r-- | indra/llcommon/stdtypes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index bae4d7a5b1..86af192a94 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -114,6 +114,10 @@ typedef U32 TPACKETID; #define FALSE (0) #endif +#if LL_FREEBSD +#undef NULL +#endif + #ifndef NULL #define NULL (0) #endif |