From 007c0da3b27cdaea82a8209498a74462a8918ce1 Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Mon, 24 Sep 2001 19:34:15 +0000 Subject: [PATCH] Add a workaround for platforms where has macros only. [SVN r11235] --- include/boost/regex/config.hpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index ae86af8a..a37499ac 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -338,6 +338,23 @@ public: * ****************************************************************************/ +#ifdef __cplusplus + +#ifdef BOOST_NO_CTYPE_FUNCTIONS + +// Make functions out of the macros. +// Use parentheses so the macros don't screw us up. +inline int (isalpha)(int c) { return isalpha(c); } +inline int (iscntrl)(int c) { return iscntrl(c); } +inline int (isdigit)(int c) { return isdigit(c); } +inline int (islower)(int c) { return islower(c); } +inline int (ispunct)(int c) { return ispunct(c); } +inline int (isspace)(int c) { return isspace(c); } +inline int (isupper)(int c) { return isupper(c); } +inline int (isxdigit)(int c) { return isxdigit(c); } + +#endif + // the following may be defined as macros; this is // incompatable with std::something syntax, we have // no choice but to undef them? @@ -437,6 +454,8 @@ public: #undef wcsxfrm #endif +#endif + /***************************************************************************** * * Fix broken broken namespace support: @@ -523,6 +542,3 @@ inline void construct(T* p, const T& t) #endif #endif - - -