diff --git a/reactos/tools/rbuild/XML.cpp b/reactos/tools/rbuild/XML.cpp index 4950aef94a2..f4cec1e4013 100644 --- a/reactos/tools/rbuild/XML.cpp +++ b/reactos/tools/rbuild/XML.cpp @@ -2,12 +2,16 @@ #include "pch.h" +#ifdef _MSC_VER +#define MAX_PATH _MAX_PATH +#endif + #ifdef WIN32 -#include -#include +# include +# include #else -#include -#define _MAX_PATH 255 +# include +# define MAX_PATH PATH_MAX #endif #include @@ -180,16 +184,10 @@ Path::RelativeFromWorkingDirectory ( const string& path ) vout.push_back ( vpath[i++] ); // now merge vout into a string again - string out; + string out = "."; for ( i = 0; i < vout.size(); i++ ) { - // this squirreliness is b/c win32 has drive letters and *nix doesn't... -#ifdef WIN32 - if ( i ) out += "/"; -#else - out += out.size() ? "/" : "./"; -#endif - out += vout[i]; + out += "/" + vout[i]; } return out; } diff --git a/reactos/tools/rbuild/pch.h b/reactos/tools/rbuild/pch.h index c46abbc1487..aa93e5d8f43 100644 --- a/reactos/tools/rbuild/pch.h +++ b/reactos/tools/rbuild/pch.h @@ -14,6 +14,10 @@ #include +#ifdef _MSC_VER +#define MAX_PATH _MAX_PATH +#endif + #ifndef WIN32 #include #include diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 33208c84e13..0d8b548f276 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -6,12 +6,14 @@ #ifdef WIN32 #include #include -#else -#define _MAX_PATH 255 #endif #include #include +#ifdef _MSC_VER +#include +#else #include +#endif #include "ssprintf.h" #include "exception.h" diff --git a/reactos/tools/rbuild/tests/functiontest.cpp b/reactos/tools/rbuild/tests/functiontest.cpp index e2b3128e399..84dede1079c 100644 --- a/reactos/tools/rbuild/tests/functiontest.cpp +++ b/reactos/tools/rbuild/tests/functiontest.cpp @@ -5,5 +5,5 @@ using std::string; void FunctionTest::Run () { string fixedupFilename = FixupTargetFilename ( "." SSEP "dir1" SSEP "dir2" SSEP ".." SSEP "filename.txt" ); - ARE_EQUAL ( "$(ROS_INTERMEDIATE)dir1" SSEP "filename.txt", fixedupFilename ); + ARE_EQUAL ( "$(ROS_INTERMEDIATE)." SSEP "dir1" SSEP "filename.txt", fixedupFilename ); } diff --git a/reactos/tools/rbuild/tests/sourcefiletest.cpp b/reactos/tools/rbuild/tests/sourcefiletest.cpp index 93d216d2c24..b67c961b9f4 100644 --- a/reactos/tools/rbuild/tests/sourcefiletest.cpp +++ b/reactos/tools/rbuild/tests/sourcefiletest.cpp @@ -38,9 +38,9 @@ SourceFileTest::IncludeTest () AutomaticDependency automaticDependency ( project ); automaticDependency.Process (); ARE_EQUAL( 4, automaticDependency.sourcefile_map.size () ); - const SourceFile* include = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile_include.h" ); + const SourceFile* include = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile_include.h" ); IS_NOT_NULL( include ); - const SourceFile* includenext = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" ); + const SourceFile* includenext = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" ); IS_NOT_NULL( includenext ); } @@ -51,9 +51,9 @@ SourceFileTest::FullParseTest () AutomaticDependency automaticDependency ( project ); automaticDependency.Process (); ARE_EQUAL( 5, automaticDependency.sourcefile_map.size () ); - const SourceFile* header1 = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1_header1.h" ); + const SourceFile* header1 = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1_header1.h" ); IS_NOT_NULL( header1 ); - const SourceFile* recurse = automaticDependency.RetrieveFromCache ( "tests" SSEP "data" SSEP "sourcefile1_recurse.h" ); + const SourceFile* recurse = automaticDependency.RetrieveFromCache ( "." SSEP "tests" SSEP "data" SSEP "sourcefile1_recurse.h" ); IS_NOT_NULL( recurse ); IS_TRUE( IsParentOf ( header1, recurse ) );