From 1f279f75afbc0968dddef5bd92eeae6ad8c2ee7b Mon Sep 17 00:00:00 2001 From: riccardom Date: Sun, 18 Jul 2010 08:51:51 +0000 Subject: [PATCH] Thou shalt not use strnicmp. Thou shalt use strncasecmp. Fix compilation on !MSC. --- desmume/src/cheatSystem.cpp | 4 ++-- desmume/src/types.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/desmume/src/cheatSystem.cpp b/desmume/src/cheatSystem.cpp index 530ed7fe3..0a4c6731b 100644 --- a/desmume/src/cheatSystem.cpp +++ b/desmume/src/cheatSystem.cpp @@ -621,8 +621,8 @@ BOOL CHEATS::load() } trim(buf); if ((strlen(buf) == 0) || (buf[0] == ';')) continue; - if(!strnicmp(buf,"name=",5)) continue; - if(!strnicmp(buf,"serial=",7)) continue; + if(!strncasecmp(buf,"name=",5)) continue; + if(!strncasecmp(buf,"serial=",7)) continue; memset(&tmp_cht, 0, sizeof(tmp_cht)); if ((buf[0] == 'D') && (buf[1] == 'S')) // internal diff --git a/desmume/src/types.h b/desmume/src/types.h index 1e9a2db84..7635bb275 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -86,6 +86,7 @@ #ifdef _MSC_VER #define strcasecmp(x,y) _stricmp(x,y) +#define strncasecmp(x, y, l) strnicmp(x, y, l) #define snprintf _snprintf #else #define WINAPI