fixes for MSVC non-standard C library
strcase => _stricmp strncase => _strnicmp strdup => _strdup snprintf => _snprintf a compliant snprintf() is supposed to be available in MS Visual Studio 2015 and later
This commit is contained in:
parent
87e4cfad94
commit
60beebc9ac
@ -40,11 +40,8 @@
|
||||
#if !defined(_MSC_VER)
|
||||
#include <strings.h>
|
||||
#else
|
||||
#if (_MSC_VER >= 1400)
|
||||
#define strncasecmp _memicmp
|
||||
#else
|
||||
#define strncasecmp memicmp
|
||||
#endif
|
||||
#define strdup _strdup
|
||||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#if !defined(__VBCC__) && !defined(_MSC_VER)
|
||||
|
||||
@ -53,6 +53,12 @@
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#if defined(_MSC_VER)
|
||||
#include <stdio.h>
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "errors.h"
|
||||
#include "global.h"
|
||||
|
||||
@ -43,7 +43,10 @@
|
||||
#include <string.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <stdio.h>
|
||||
#define strdup _strdup
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#else
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(__WIN32__) || defined(WIN32)
|
||||
#include <windows.h>
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#elif defined(__macosx__) || defined(__FreeBSD__)
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
//#include <fcntl.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !defined(__VBCC__) && !defined(_MSC_VER)
|
||||
@ -58,10 +57,13 @@
|
||||
#ifdef GRAFX2_CATCHES_SIGNALS
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#include <stdio.h>
|
||||
#if defined(_MSC_VER)
|
||||
#define strncasecmp _strnicmp
|
||||
#define strdup _strdup
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "buttons.h"
|
||||
#include "const.h"
|
||||
|
||||
@ -33,6 +33,12 @@
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#if defined(_MSC_VER)
|
||||
#define strdup _strdup
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <SDL_image.h>
|
||||
|
||||
@ -29,6 +29,9 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#if defined(_MSC_VER)
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
#include "const.h"
|
||||
#include "errors.h"
|
||||
|
||||
@ -60,8 +60,11 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <stdio.h>
|
||||
#define strdup _strdup
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Virtual keyboard is ON by default on these platforms:
|
||||
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__) || defined(GCWZERO)
|
||||
|
||||
@ -40,8 +40,12 @@
|
||||
|
||||
// POSIX calls it strcasecmp, Windows uses stricmp... no ANSI standard.
|
||||
#ifdef WIN32
|
||||
#ifdef _MSC_VER
|
||||
#define strcasecmp _stricmp
|
||||
#else
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Definition of the base data types
|
||||
/// 8bit unsigned integer
|
||||
|
||||
@ -52,8 +52,11 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <stdio.h>
|
||||
#define strdup _strdup
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <SDL_image.h>
|
||||
#include "SFont.h"
|
||||
|
||||
@ -31,8 +31,10 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <stdio.h>
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user