]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/StrGather/StrGather.c
To fix tool StrGather.exe can not work correctly in Linux environment.
[mirror_edk2.git] / Tools / CCode / Source / StrGather / StrGather.c
index 9eb5c5a19e8ae26ba0b9e5c61c358f0df4c8ee90..8908b430a156c0ae1a68ced5c4452669a5b3fb88 100644 (file)
@@ -48,6 +48,16 @@ Abstract:
 #define MODE_PARSE    1\r
 #define MODE_SCAN     2\r
 #define MODE_DUMP     3\r
+//\r
+// Different file separater for Linux and Windows\r
+//\r
+#ifdef __GNUC__\r
+#define FILE_SEP_CHAR '/'\r
+#define FILE_SEP_STRING "/"\r
+#else\r
+#define FILE_SEP_CHAR '\\'\r
+#define FILE_SEP_STRING "\\"\r
+#endif\r
 \r
 //\r
 // We keep a linked list of these for the source files we process\r
@@ -1583,8 +1593,8 @@ ProcessArgs (
       }\r
 \r
       strcpy (NewList->Str, Argv[1]);\r
-      if (NewList->Str[strlen (NewList->Str) - 1] != '\\') {\r
-        strcat (NewList->Str, "\\");\r
+      if (NewList->Str[strlen (NewList->Str) - 1] != FILE_SEP_CHAR) {\r
+        strcat (NewList->Str, FILE_SEP_STRING);\r
       }\r
       //\r
       // Add it to our linked list\r