[ros-diffs] [cfinck] 32681: 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)

cfinck at svn.reactos.org cfinck at svn.reactos.org
Sat Mar 15 00:55:33 CET 2008


Author: cfinck
Date: Fri Mar 14 18:55:32 2008
New Revision: 32681

URL: http://svn.reactos.org/svn/reactos?rev=3D32681&view=3Drev
Log:
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)

Modified:
    trunk/reactos/tools/cabman/dfp.cxx
    trunk/reactos/tools/ssprintf.cpp
    trunk/reactos/tools/xml.cpp

Modified: trunk/reactos/tools/cabman/dfp.cxx
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/dfp.cxx?=
rev=3D32681&r1=3D32680&r2=3D32681&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/cabman/dfp.cxx (original)
+++ trunk/reactos/tools/cabman/dfp.cxx Fri Mar 14 18:55:32 2008
@@ -1373,9 +1373,9 @@
                 return;
             }
             i =3D 0;
-            while (((CurrentChar + i < LineLength) &&
+            while ((CurrentChar + i < LineLength) &&
                 (((ch =3D Line[CurrentChar + i]) >=3D 'a') && (ch <=3D 'z'=
)) ||
-                ((ch >=3D 'A') && (ch <=3D 'Z')) || (ch =3D=3D '_')))
+                ((ch >=3D 'A') && (ch <=3D 'Z')) || (ch =3D=3D '_'))
             {
                 CurrentString[i] =3D ch;
                 i++;

Modified: trunk/reactos/tools/ssprintf.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/ssprintf.cpp?re=
v=3D32681&r1=3D32680&r2=3D32681&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/ssprintf.cpp (original)
+++ trunk/reactos/tools/ssprintf.cpp Fri Mar 14 18:55:32 2008
@@ -14,20 +14,25 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 =

-#if defined(__FreeBSD__) || defined(__APPLE__)
-# include <stdlib.h>
-#else
-# include <malloc.h>
-#endif // __FreeBSD__
+// For character conversion functions like "wctomb" and "alloca" under Unix
+#include <stdlib.h>
+
+#if defined(WIN32)
+    // Under Win32 hosts, "alloca" is not defined by stdlib.h, but by mall=
oc.h
+    // On the other hand, malloc.h is deprecated under some Unix hosts, so=
 only include it for Win32 hosts.
+    #include <malloc.h>
+#endif
+
+#include <ctype.h>
 #include <math.h>
 #include <float.h>
 #include <assert.h>
 #include "ssprintf.h"
 =

 #ifndef WIN32
-#include <ctype.h>
 #define _finite __finite
 #define _isnan __isnan
+#endif
 =

 #ifndef __APPLE__
 inline int iswdigit ( wchar_t c )
@@ -35,7 +40,6 @@
 	return ( c >=3D L'0' && c <=3D L'9' );
 }
 #endif
-#endif//WIN32
 =

 #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__CYGWIN__)
 # define __isnan isnan

Modified: trunk/reactos/tools/xml.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/xml.cpp?rev=3D3=
2681&r1=3D32680&r2=3D32681&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/xml.cpp (original)
+++ trunk/reactos/tools/xml.cpp Fri Mar 14 18:55:32 2008
@@ -21,15 +21,23 @@
 #endif//_MSC_VER
 =

 #ifdef WIN32
-#	include <direct.h>
-#	include <io.h>
+    #include <direct.h>
+    #include <io.h>
 #else
-#	include <sys/stat.h>
-#	include <unistd.h>
-#	include <ctype.h>
-#	define MAX_PATH PATH_MAX
+    #include <sys/stat.h>
+    #include <unistd.h>
+
+    // Some hosts don't define PATH_MAX in unistd.h
+    #if !defined(PATH_MAX)
+        #include <limits.h>
+    #endif
+
+    #define MAX_PATH PATH_MAX
 #endif
+
 #include <assert.h>
+#include <ctype.h>
+#include <string.h>
 =

 #include "xml.h"
 #include "ssprintf.h"




More information about the Ros-diffs mailing list