\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
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
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
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
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