[Scummvm-git-logs] scummvm-tools master -> 8948f6e1689508a6bb99e7d04605e098ce5f0e04

mgerhardy noreply at scummvm.org
Tue Jun 30 10:27:48 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://api.github.com/repos/scummvm/scummvm-tools .

Summary:
8948f6e168 MACS2: hopefully fixed compilation issues for windows and macos


Commit: 8948f6e1689508a6bb99e7d04605e098ce5f0e04
    https://github.com/scummvm/scummvm-tools/commit/8948f6e1689508a6bb99e7d04605e098ce5f0e04
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-06-30T12:27:37+02:00

Commit Message:
MACS2: hopefully fixed compilation issues for windows and macos

Changed paths:
    engines/macs2/demacs2.cpp
    engines/macs2/extract_macs2.cpp


diff --git a/engines/macs2/demacs2.cpp b/engines/macs2/demacs2.cpp
index 8228c3dc..6545b39f 100644
--- a/engines/macs2/demacs2.cpp
+++ b/engines/macs2/demacs2.cpp
@@ -37,6 +37,12 @@ static uint32_t stringDataSize = 0;
 
 static bool amigaMode = false;
 
+static std::string uintToString(uint32_t value) {
+	char buf[16];
+	snprintf(buf, sizeof(buf), "%u", value);
+	return buf;
+}
+
 static void appendUtf8(std::string &out, uint8_t ch) {
 	if (ch < 0x80) {
 		out += (char)ch;
@@ -1794,7 +1800,7 @@ static std::string decodeCLine(uint8_t opcode, uint32_t endPos, int &indent) {
 		uint16_t s = readWord();
 		uint16_t n = readWord();
 		std::string decoded = decodeString(s, n);
-		std::string result2 = std::string(opcode == 0x0A ? "printStringLeft(" : "printStringRight(") + x + ", " + y + ", " + std::to_string(s) + ", " + std::to_string(n) + ");";
+		std::string result2 = std::string(opcode == 0x0A ? "printStringLeft(" : "printStringRight(") + x + ", " + y + ", " + uintToString(s) + ", " + uintToString(n) + ");";
 		if (!decoded.empty())
 			result2 += " // \"" + decoded + "\"";
 		return result2;
@@ -1825,7 +1831,7 @@ static std::string decodeCLine(uint8_t opcode, uint32_t endPos, int &indent) {
 		uint16_t so = readWord();
 		uint16_t n = readWord();
 		std::string decoded = decodeString(so, n);
-		std::string result2 = std::string("showDialogue(") + o + ", " + x + ", " + y + ", " + s + ", " + std::to_string(so) + ", " + std::to_string(n) + ");";
+		std::string result2 = std::string("showDialogue(") + o + ", " + x + ", " + y + ", " + s + ", " + uintToString(so) + ", " + uintToString(n) + ");";
 		if (!decoded.empty())
 			result2 += " // \"" + decoded + "\"";
 		return result2;
@@ -1874,7 +1880,7 @@ static std::string decodeCLine(uint8_t opcode, uint32_t endPos, int &indent) {
 		uint16_t s = readWord();
 		uint16_t n = readWord();
 		std::string decoded = decodeString(s, n);
-		std::string result2 = std::string("addDialogueChoice(") + i + ", " + std::to_string(s) + ", " + std::to_string(n) + ");";
+		std::string result2 = std::string("addDialogueChoice(") + i + ", " + uintToString(s) + ", " + uintToString(n) + ");";
 		if (!decoded.empty())
 			result2 += " // \"" + decoded + "\"";
 		return result2;
@@ -2077,7 +2083,7 @@ static std::string decodeCLine(uint8_t opcode, uint32_t endPos, int &indent) {
 		uint16_t s = readWord();
 		uint16_t t = readWord();
 		std::string decoded = decodeString(s, 1);
-		std::string result2 = std::string("addOverlayTextEntry(") + x + ", " + y + ", " + a + ", " + std::to_string(s) + ", " + std::to_string(t) + ");";
+		std::string result2 = std::string("addOverlayTextEntry(") + x + ", " + y + ", " + a + ", " + uintToString(s) + ", " + uintToString(t) + ");";
 		if (!decoded.empty())
 			result2 += " // \"" + decoded + "\"";
 		return result2;
diff --git a/engines/macs2/extract_macs2.cpp b/engines/macs2/extract_macs2.cpp
index 60b7a5a7..dbcd7477 100644
--- a/engines/macs2/extract_macs2.cpp
+++ b/engines/macs2/extract_macs2.cpp
@@ -28,10 +28,25 @@
 #include <set>
 #include <string>
 #include <vector>
-#ifdef WIN32
-#include <direct.h>
-#else
 #include <sys/stat.h>
+#ifdef _WIN32
+#include <direct.h>
+#endif
+
+#ifndef S_ISDIR
+#ifdef S_IFDIR
+#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
+#elif defined(_S_IFDIR)
+#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
+#endif
+#endif
+
+#ifndef S_ISREG
+#ifdef S_IFREG
+#define S_ISREG(m) (((m) & S_IFREG) == S_IFREG)
+#elif defined(_S_IFREG)
+#define S_ISREG(m) (((m) & _S_IFREG) == _S_IFREG)
+#endif
 #endif
 
 static FILE *resFile = nullptr;




More information about the Scummvm-git-logs mailing list