[Scummvm-git-logs] scummvm master -> 098a53217b6da73b7d904271c0b5af90aeb25ca0

SupSuper supsuper at gmail.com
Thu Mar 4 15:52:00 UTC 2021


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

Summary:
098a53217b PRIVATE: Fix compilation in MSVC


Commit: 098a53217b6da73b7d904271c0b5af90aeb25ca0
    https://github.com/scummvm/scummvm/commit/098a53217b6da73b7d904271c0b5af90aeb25ca0
Author: SupSuper (supsuper at gmail.com)
Date: 2021-03-04T15:51:14Z

Commit Message:
PRIVATE: Fix compilation in MSVC

Changed paths:
    engines/private/lexer.cpp
    engines/private/lexer.l
    engines/private/symbol.cpp


diff --git a/engines/private/lexer.cpp b/engines/private/lexer.cpp
index ec5586ccd0..7091c5070e 100644
--- a/engines/private/lexer.cpp
+++ b/engines/private/lexer.cpp
@@ -777,6 +777,7 @@ char *yytext;
  */
 #define YY_NO_INPUT 1
 #line 31 "engines/private/lexer.l"
+#define YY_NO_UNISTD_H
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 
 #include "private/private.h"
diff --git a/engines/private/lexer.l b/engines/private/lexer.l
index 2563bdbb44..9469cc14a8 100644
--- a/engines/private/lexer.l
+++ b/engines/private/lexer.l
@@ -28,6 +28,7 @@
 %option prefix="PRIVATE_"
 
 %{
+#define YY_NO_UNISTD_H
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 
 #include "private/private.h"
diff --git a/engines/private/symbol.cpp b/engines/private/symbol.cpp
index ff4b8ceb95..a86f8496c6 100644
--- a/engines/private/symbol.cpp
+++ b/engines/private/symbol.cpp
@@ -47,6 +47,7 @@
 #include "private/grammar.h"
 #include "private/private.h"
 #include "private/tokens.h"
+#include "common/str.h"
 
 namespace Private {
 
@@ -89,7 +90,7 @@ static Symbol *install(const Common::String &n, int t, int d, const char *s, Com
     if (t == NUM || t == NAME)
         sp->u.val = d;
     else if (t == STRING)
-        sp->u.str = strndup(s, strlen(s)); // FIXME: leaks a string here.
+        sp->u.str = scumm_strdup(s); // FIXME: leaks a string here.
     else if (t == RECT)
         sp->u.rect = r;
     else




More information about the Scummvm-git-logs mailing list