]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/GenFvImage/GenFvImageLib.c
Update ParseInf to resolve different line separator between WINDOWS and LINUX (\r...
[mirror_edk2.git] / Tools / CCode / Source / GenFvImage / GenFvImageLib.c
index 45d4c8e848bf7897829e4e431c8feb1ba2c60b3a..06500ef3736d87160df4b1de8e9bac8da6f71e2f 100644 (file)
@@ -48,6 +48,17 @@ Abstract:
 #include "EfiCompress.h"\r
 #include "WinNtInclude.h"\r
 \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
 static UINT32 MaxFfsAlignment = 0;\r
 //\r
 // Local function prototypes\r
@@ -1374,7 +1385,7 @@ Returns:
   // Copy the file name for the path of the sym file and truncate the name portion.\r
   //\r
   strcpy (SymFileName, Buffer);\r
-  Ptr = strrchr (SymFileName, '\\');\r
+  Ptr = strrchr (SymFileName, FILE_SEP_CHAR);\r
   assert (Ptr);\r
   Ptr[0] = 0;\r
 \r
@@ -1411,7 +1422,7 @@ Returns:
     // Add the symbol file name and extension to the file path.\r
     //\r
     strcat (Buffer, ".sym");\r
-    strcat (SymFileName, "\\");\r
+    strcat (SymFileName, FILE_SEP_CHAR);\r
     strcat (SymFileName, Buffer);\r
   } else {\r
     //\r