diff options
-rw-r--r-- | Source/cmStandardIncludes.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 70d2048bf6..e18fff6956 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -102,6 +102,21 @@ public: #include <stdio.h> #include <stdlib.h> +// Borland C++ defines several of the stdlib.h and string.h symbols in +// sub-headers search.h and mem.h. These sub-headers have using +// declarations to pull functions from the std namespace to the global +// namespace, but they are defined only if the header was not included +// through the C++-style cstdlib or cstring header. These outer +// headers are included by the streams library in C++-style and +// include blockers are put in place that prevent including the +// C-style versions from ever including the sub-headers. Therefore we +// have to include the sub-headers here to get the using declarations. +#if defined(__BORLANDC__) +# include <mem.h> /* mem... functions from string.h */ +# include <search.h> /* search functions from stdlib.h */ +#endif + + #if !defined(_WIN32) && defined(__COMO__) // Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE. extern "C" |