compatibility fixes
authorRoyce Mitchell III <royce3@ev1.net>
Thu, 3 Feb 2005 23:54:02 +0000 (23:54 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Thu, 3 Feb 2005 23:54:02 +0000 (23:54 +0000)
svn path=/branches/xmlbuildsystem/; revision=13401

reactos/tools/rbuild/XML.cpp
reactos/tools/rbuild/pch.h
reactos/tools/rbuild/rbuild.h
reactos/tools/rbuild/tests/functiontest.cpp
reactos/tools/rbuild/tests/sourcefiletest.cpp

index 4950aef..f4cec1e 100644 (file)
@@ -2,12 +2,16 @@
 \r
 #include "pch.h"\r
 \r
+#ifdef _MSC_VER\r
+#define MAX_PATH _MAX_PATH\r
+#endif\r
+\r
 #ifdef WIN32\r
-#include <direct.h>\r
-#include <io.h>\r
+#      include <direct.h>\r
+#      include <io.h>\r
 #else\r
-#include <sys/stat.h>\r
-#define _MAX_PATH 255\r
+#      include <sys/stat.h>\r
+#      define MAX_PATH PATH_MAX\r
 #endif\r
 #include <assert.h>\r
 \r
@@ -180,16 +184,10 @@ Path::RelativeFromWorkingDirectory ( const string& path )
                vout.push_back ( vpath[i++] );\r
 \r
        // now merge vout into a string again\r
-       string out;\r
+       string out = ".";\r
        for ( i = 0; i < vout.size(); i++ )\r
        {\r
-               // this squirreliness is b/c win32 has drive letters and *nix doesn't...\r
-#ifdef WIN32\r
-               if ( i ) out += "/";\r
-#else\r
-               out += out.size() ? "/" : "./";\r
-#endif\r
-               out += vout[i];\r
+               out += "/" + vout[i];\r
        }\r
        return out;\r
 }\r
index c46abbc..aa93e5d 100644 (file)
 \r
 #include <stdarg.h>\r
 \r
+#ifdef _MSC_VER\r
+#define MAX_PATH _MAX_PATH\r
+#endif\r
+\r
 #ifndef WIN32\r
 #include <wctype.h>\r
 #include <math.h>\r
index 33208c8..0d8b548 100644 (file)
@@ -6,12 +6,14 @@
 #ifdef WIN32\r
 #include <direct.h>\r
 #include <io.h>\r
-#else\r
-#define _MAX_PATH 255\r
 #endif\r
 #include <sys/stat.h>\r
 #include <time.h>\r
+#ifdef _MSC_VER\r
+#include <sys/utime.h>\r
+#else\r
 #include <utime.h>\r
+#endif\r
 \r
 #include "ssprintf.h"\r
 #include "exception.h"\r
index e2b3128..84dede1 100644 (file)
@@ -5,5 +5,5 @@ using std::string;
 void FunctionTest::Run ()\r
 {\r
        string fixedupFilename = FixupTargetFilename ( "." SSEP "dir1" SSEP "dir2" SSEP ".." SSEP "filename.txt" );\r
-       ARE_EQUAL ( "$(ROS_INTERMEDIATE)dir1" SSEP "filename.txt", fixedupFilename );\r
+       ARE_EQUAL ( "$(ROS_INTERMEDIATE)." SSEP "dir1" SSEP "filename.txt", fixedupFilename );\r
 }\r
index 93d216d..b67c961 100644 (file)
@@ -38,9 +38,9 @@ SourceFileTest::IncludeTest ()
        AutomaticDependency automaticDependency ( project );\r
        automaticDependency.Process ();\r
        ARE_EQUAL( 4, automaticDependency.sourcefile_map.size () );\r
-       const SourceFile* include = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile_include.h" );\r
+       const SourceFile* include = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile_include.h" );\r
        IS_NOT_NULL( include );\r
-       const SourceFile* includenext = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" );\r
+       const SourceFile* includenext = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" );\r
        IS_NOT_NULL( includenext );\r
 }\r
 \r
@@ -51,9 +51,9 @@ SourceFileTest::FullParseTest ()
        AutomaticDependency automaticDependency ( project );\r
        automaticDependency.Process ();\r
        ARE_EQUAL( 5, automaticDependency.sourcefile_map.size () );\r
-       const SourceFile* header1 = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1_header1.h" );\r
+       const SourceFile* header1 = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1_header1.h" );\r
        IS_NOT_NULL( header1 );\r
-       const SourceFile* recurse = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1_recurse.h" );\r
+       const SourceFile* recurse = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1_recurse.h" );\r
        IS_NOT_NULL( recurse );\r
        IS_TRUE( IsParentOf ( header1,\r
                              recurse ) );\r