aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorJohannes Schickel2012-02-22 03:45:44 +0100
committerJohannes Schickel2012-02-22 03:45:44 +0100
commit221b78e4e2c057a3494618e2dfbd2f2b1f1ffe01 (patch)
tree353e5a75fc0880a52231ef02fb794de43aeae97a /devtools
parent6c64fdf4f2e862a15ebd3e336445a89c10deb723 (diff)
downloadscummvm-rg350-221b78e4e2c057a3494618e2dfbd2f2b1f1ffe01.tar.gz
scummvm-rg350-221b78e4e2c057a3494618e2dfbd2f2b1f1ffe01.tar.bz2
scummvm-rg350-221b78e4e2c057a3494618e2dfbd2f2b1f1ffe01.zip
DEVTOOLS: Copy scumm_stricmp implementation to create_kyradat.
This should fix bug #3489654 "DEVTOOLS: create_kyradat linkerror".
Diffstat (limited to 'devtools')
-rw-r--r--devtools/create_kyradat/module.mk3
-rw-r--r--devtools/create_kyradat/util.cpp13
-rw-r--r--devtools/create_kyradat/util.h1
3 files changed, 14 insertions, 3 deletions
diff --git a/devtools/create_kyradat/module.mk b/devtools/create_kyradat/module.mk
index 4241f82e34..fb458b43ff 100644
--- a/devtools/create_kyradat/module.mk
+++ b/devtools/create_kyradat/module.mk
@@ -14,8 +14,5 @@ MODULE_OBJS := \
# Set the name of the executable
TOOL_EXECUTABLE := create_kyradat
-# Link against common code (for scumm_stricmp)
-TOOL_DEPS := common/libcommon.a
-
# Include common rules
include $(srcdir)/rules.mk
diff --git a/devtools/create_kyradat/util.cpp b/devtools/create_kyradat/util.cpp
index 2420f44168..5ce8237b85 100644
--- a/devtools/create_kyradat/util.cpp
+++ b/devtools/create_kyradat/util.cpp
@@ -54,6 +54,19 @@ void warning(const char *s, ...) {
fprintf(stderr, "WARNING: %s!\n", buf);
}
+int scumm_stricmp(const char *s1, const char *s2) {
+ byte l1, l2;
+ do {
+ // Don't use ++ inside tolower, in case the macro uses its
+ // arguments more than once.
+ l1 = (byte)*s1++;
+ l1 = tolower(l1);
+ l2 = (byte)*s2++;
+ l2 = tolower(l2);
+ } while (l1 == l2 && l1 != 0);
+ return l1 - l2;
+}
+
void debug(int level, const char *s, ...) {
char buf[1024];
va_list va;
diff --git a/devtools/create_kyradat/util.h b/devtools/create_kyradat/util.h
index 0d8e15cc37..a2783cca71 100644
--- a/devtools/create_kyradat/util.h
+++ b/devtools/create_kyradat/util.h
@@ -50,6 +50,7 @@ uint32 fileSize(FILE *fp);
void NORETURN_PRE error(const char *s, ...) NORETURN_POST;
void warning(const char *s, ...);
void debug(int level, const char *s, ...);
+int scumm_stricmp(const char *s1, const char *s2);
using namespace Common;