From cf076f2c7b65bb0909a3d7ae291924531be371fc Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Fri, 14 Mar 2008 23:55:32 +0000 Subject: [PATCH] Change, simplify and document the conditions for the include files. Fix two build problems in Fedora 8 and probably other hosts with a newer C library (reported by Dosadi on #reactos) svn path=/trunk/; revision=32681 --- reactos/tools/cabman/dfp.cxx | 4 ++-- reactos/tools/ssprintf.cpp | 18 +++++++++++------- reactos/tools/xml.cpp | 20 ++++++++++++++------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/reactos/tools/cabman/dfp.cxx b/reactos/tools/cabman/dfp.cxx index df20c71b7cb..2c8995a5f84 100755 --- a/reactos/tools/cabman/dfp.cxx +++ b/reactos/tools/cabman/dfp.cxx @@ -1373,9 +1373,9 @@ void CDFParser::NextToken() return; } i = 0; - while (((CurrentChar + i < LineLength) && + while ((CurrentChar + i < LineLength) && (((ch = Line[CurrentChar + i]) >= 'a') && (ch <= 'z')) || - ((ch >= 'A') && (ch <= 'Z')) || (ch == '_'))) + ((ch >= 'A') && (ch <= 'Z')) || (ch == '_')) { CurrentString[i] = ch; i++; diff --git a/reactos/tools/ssprintf.cpp b/reactos/tools/ssprintf.cpp index 17f23086177..4e41579d41b 100644 --- a/reactos/tools/ssprintf.cpp +++ b/reactos/tools/ssprintf.cpp @@ -14,20 +14,25 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if defined(__FreeBSD__) || defined(__APPLE__) -# include -#else -# include -#endif // __FreeBSD__ +// For character conversion functions like "wctomb" and "alloca" under Unix +#include + +#if defined(WIN32) + // Under Win32 hosts, "alloca" is not defined by stdlib.h, but by malloc.h + // On the other hand, malloc.h is deprecated under some Unix hosts, so only include it for Win32 hosts. + #include +#endif + +#include #include #include #include #include "ssprintf.h" #ifndef WIN32 -#include #define _finite __finite #define _isnan __isnan +#endif #ifndef __APPLE__ inline int iswdigit ( wchar_t c ) @@ -35,7 +40,6 @@ inline int iswdigit ( wchar_t c ) return ( c >= L'0' && c <= L'9' ); } #endif -#endif//WIN32 #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__CYGWIN__) # define __isnan isnan diff --git a/reactos/tools/xml.cpp b/reactos/tools/xml.cpp index 50562cf4fb9..429eeec798c 100644 --- a/reactos/tools/xml.cpp +++ b/reactos/tools/xml.cpp @@ -21,15 +21,23 @@ #endif//_MSC_VER #ifdef WIN32 -# include -# include + #include + #include #else -# include -# include -# include -# define MAX_PATH PATH_MAX + #include + #include + + // Some hosts don't define PATH_MAX in unistd.h + #if !defined(PATH_MAX) + #include + #endif + + #define MAX_PATH PATH_MAX #endif + #include +#include +#include #include "xml.h" #include "ssprintf.h"