Work around fix for a compilation error on Linux
authorJean-Paul Mari <djipi.mari@gmail.com>
Wed, 18 Nov 2020 06:01:50 +0000 (01:01 -0500)
committerJean-Paul Mari <djipi.mari@gmail.com>
Wed, 18 Nov 2020 06:01:50 +0000 (01:01 -0500)
EEPROM directory creation allowed only for Windows at the moment.

.gitignore
docs/vj_HistoryNotes.txt
src/eeprom.cpp

index a3660b8..af3f26c 100644 (file)
@@ -34,4 +34,4 @@ virtualjaguar.WinMerge
 /Win-VS2017/GeneratedFiles/\r
 /Win-VS2017/GeneratedFiles/qrc_virtualjaguar.cpp\r
 /Win-VS2017/My Inspector Results - virtualjaguar\r
 /Win-VS2017/GeneratedFiles/\r
 /Win-VS2017/GeneratedFiles/qrc_virtualjaguar.cpp\r
 /Win-VS2017/My Inspector Results - virtualjaguar\r
-/Win-VS2019/
+/Win-VS2019/\r
index 67ce196..cfd07ea 100644 (file)
@@ -22,6 +22,8 @@ Release 5 (TBA)
 -- Will avoid source code mismatching with the ELF executable
 15) Remove Visual Studio 2015 support
 16) Project has switched to libdwarf 20201020 library 64bits for VS 2017
 -- Will avoid source code mismatching with the ELF executable
 15) Remove Visual Studio 2015 support
 16) Project has switched to libdwarf 20201020 library 64bits for VS 2017
+17) Work around fix for a compilation error on Linux
+-- EEPROM directory creation allowed only for Windows at the moment
 
 Release 4a (15th August 2019)
 -----------------------------
 
 Release 4a (15th August 2019)
 -----------------------------
index 9062c2c..7e21166 100644 (file)
@@ -9,14 +9,19 @@
 // JLH = James Hammons <jlhamm@acm.org>\r
 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>\r
 //\r
 // JLH = James Hammons <jlhamm@acm.org>\r
 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>\r
 //\r
-// Who  When        What\r
-// ---  ----------  ------------------------------------------------------------\r
-// JLH  01/16/2010  Created this log ;-)\r
-// JPM  10/11/2017  Directory detection and creation if missing\r
+// Who  When (MM/DD/YY)  What\r
+// ---  ---------------  ------------------------------------------------------------\r
+// JLH  01/16/2010       Created this log ;-)\r
+// JPM  10/11/2017       EEPROM directory detection and creation if missing\r
+// JPM  11/18/2020       EEPROM directory creation allowed only for Windows\r
 //\r
 \r
 #include "eeprom.h"\r
 //\r
 \r
 #include "eeprom.h"\r
+#if _WIN32 || _WIN64\r
 #include <direct.h>\r
 #include <direct.h>\r
+#else\r
+#define _mkdir(dir) 1\r
+#endif\r
 #include <stdlib.h>\r
 #include <string.h>                                                            // For memset\r
 #include "jaguar.h"\r
 #include <stdlib.h>\r
 #include <string.h>                                                            // For memset\r
 #include "jaguar.h"\r
@@ -114,10 +119,14 @@ void EepromInit(void)
 void EepromReset(void)\r
 {\r
        if (!haveEEPROM)\r
 void EepromReset(void)\r
 {\r
        if (!haveEEPROM)\r
+       {\r
                memset(eeprom_ram, 0xFF, 64 * sizeof(uint16_t));\r
                memset(eeprom_ram, 0xFF, 64 * sizeof(uint16_t));\r
+       }\r
 \r
        if (!haveCDROMEEPROM)\r
 \r
        if (!haveCDROMEEPROM)\r
+       {\r
                memset(cdromEEPROM, 0xFF, 64 * sizeof(uint16_t));\r
                memset(cdromEEPROM, 0xFF, 64 * sizeof(uint16_t));\r
+       }\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -173,8 +182,10 @@ void ReadEEPROMFromFile(FILE * file, uint16_t * ram)
        uint8_t buffer[128];\r
        size_t ignored = fread(buffer, 1, 128, file);\r
 \r
        uint8_t buffer[128];\r
        size_t ignored = fread(buffer, 1, 128, file);\r
 \r
-       for(int i=0; i<64; i++)\r
+       for (int i = 0; i < 64; i++)\r
+       {\r
                ram[i] = (buffer[(i * 2) + 0] << 8) | buffer[(i * 2) + 1];\r
                ram[i] = (buffer[(i * 2) + 0] << 8) | buffer[(i * 2) + 1];\r
+       }\r
 }\r
 \r
 \r
 }\r
 \r
 \r