New define IDSTR_NO_REDIRECT

The defines in idlib/Str.h won't be set to redirect the low
level c string functions to idStr when IDSTR_NO_REDIRECT is
set.

Fixes compilation for MSVC:
error C2761: 'Cmp' : member function redeclaration not allowed

Reported by spiral.
This commit is contained in:
dhewg 2011-12-22 03:02:29 +01:00
parent 540bbae490
commit cdf6fa3702
2 changed files with 5 additions and 0 deletions

View file

@ -40,6 +40,7 @@ If you have questions concerning this license or the applicable additional terms
*/
// these library functions should not be used for cross platform compatibility
#ifndef IDSTR_NO_REDIRECT
#define strcmp idStr::Cmp // use_idStr_Cmp
#define strncmp use_idStr_Cmpn
@ -76,6 +77,7 @@ If you have questions concerning this license or the applicable additional terms
#define _snprintf use_idStr_snPrintf
#define vsnprintf use_idStr_vsnPrintf
#define _vsnprintf use_idStr_vsnPrintf
#endif
class idVec4;

View file

@ -28,6 +28,9 @@ If you have questions concerning this license or the applicable additional terms
#include <SDL_cpuinfo.h>
// MSVC header intrin.h uses strcmp and errors out when not set
#define IDSTR_NO_REDIRECT
#include "sys/platform.h"
#include "framework/Common.h"