From 0b7e5ce3e62e56dba0537fa0c50ba939f44cfac4 Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 4 Jan 2012 16:51:50 +0000 Subject: [PATCH] Proper fix to my previous failed fix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3955 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_cmdlib.c | 10 ++++++++++ engine/qclib/qcc_pr_lex.c | 15 +++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/engine/qclib/qcc_cmdlib.c b/engine/qclib/qcc_cmdlib.c index 8c1fd8802..b3c4b6b84 100644 --- a/engine/qclib/qcc_cmdlib.c +++ b/engine/qclib/qcc_cmdlib.c @@ -10,6 +10,16 @@ extern jmp_buf qcccompileerror; #endif +#ifdef _WIN64 + #ifdef _SDL + #define snprintf linuxlike_snprintf + int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3); + #define vsnprintf linuxlike_vsnprintf + int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_list argptr); + void *__imp__vsnprintf = vsnprintf; + #endif +#endif + // set these before calling CheckParm int myargc; char **myargv; diff --git a/engine/qclib/qcc_pr_lex.c b/engine/qclib/qcc_pr_lex.c index dd4d321fe..2579d9e94 100644 --- a/engine/qclib/qcc_pr_lex.c +++ b/engine/qclib/qcc_pr_lex.c @@ -6,15 +6,14 @@ #endif #include "time.h" -// Win64 + SDL = undfined reference to vsnprintf #ifdef _WIN64 -#ifdef SDL_MAJOR_VERSION - //msvc crap - #define snprintf linuxlike_snprintf - int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3); - #define vsnprintf linuxlike_vsnprintf - int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_list argptr); -#endif + #ifdef _SDL + #define snprintf linuxlike_snprintf + int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3); + #define vsnprintf linuxlike_vsnprintf + int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_list argptr); + //void *__imp__vsnprintf = vsnprintf; + #endif #endif #define MEMBERFIELDNAME "__m%s"