mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-25 05:11:35 +00:00
GoaLitiuM's changes to fix msvc2015's cmake support.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5594 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b4de288ca7
commit
d16c6646b7
15 changed files with 119 additions and 91 deletions
|
@ -69,6 +69,12 @@ ENDIF()
|
|||
SET(FTE_BUILD_CONFIG ${CMAKE_HOME_DIRECTORY}/engine/common/config_fteqw.h CACHE FILEPATH "Which build config file to use to control supported features.")
|
||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};CONFIG_FILE_NAME=${FTE_BUILD_CONFIG})
|
||||
|
||||
IF(NOT WIN32)
|
||||
SET(SYS_LIBS ${SYS_LIBS} m)
|
||||
ELSE()
|
||||
SET(SYS_LIBS ${SYS_LIBS})
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(ZLIB)
|
||||
IF(ZLIB_FOUND)
|
||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};ZLIB_STATIC)
|
||||
|
@ -181,7 +187,7 @@ IF(${ANDROID})
|
|||
# INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
|
||||
|
||||
SET(FTE_DEFINES ${FTE_DEFINES};ANDROID;VKQUAKE;MULTITHREAD)
|
||||
SET(FTE_LIBS ${FTE_LIBS} android log EGL m ${CMAKE_DL_LIBS})
|
||||
SET(FTE_LIBS ${FTE_LIBS} android log EGL ${SYS_LIBS} ${CMAKE_DL_LIBS})
|
||||
SET(FTE_ARCH_FILES
|
||||
engine/client/sys_droid.c
|
||||
engine/common/sys_linux_threads.c
|
||||
|
@ -262,7 +268,7 @@ ELSEIF(${UNIX}) #linux(ish)
|
|||
ENDIF()
|
||||
|
||||
SET(FTE_DEFINES ${FTE_DEFINES};DYNAMIC_SDL;MULTITHREAD)
|
||||
SET(FTE_LIBS ${FTE_LIBS} m ${CMAKE_DL_LIBS} pthread ${SDL2_LIBRARIES})
|
||||
SET(FTE_LIBS ${FTE_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} pthread ${SDL2_LIBRARIES})
|
||||
SET(FTE_ARCH_FILES
|
||||
engine/client/sys_linux.c
|
||||
engine/common/sys_linux_threads.c
|
||||
|
@ -317,7 +323,7 @@ ELSEIF(${UNIX}) #linux(ish)
|
|||
engine/common/net_ssl_gnutls.c
|
||||
# engine/common/net_ssl_openssl.c
|
||||
)
|
||||
SET(FTESV_LIBS ${FTESV_LIBS} m ${CMAKE_DL_LIBS} pthread)
|
||||
SET(FTESV_LIBS ${FTESV_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} pthread)
|
||||
|
||||
# SET(FTE_DEFINES ${FTE_DEFINES};HAVE_OPENSSL)
|
||||
# SET(FTESV_DEFINES ${FTESV_DEFINES};HAVE_OPENSSL)
|
||||
|
@ -336,7 +342,7 @@ ELSEIF(1) #SDL
|
|||
|
||||
#SDL2.0.7 supports vulkan, so lets use it.
|
||||
SET(FTE_DEFINES ${FTE_DEFINES};FTE_SDL)
|
||||
SET(FTE_LIBS ${FTE_LIBS} m ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
|
||||
SET(FTE_LIBS ${FTE_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
|
||||
SET(FTE_ARCH_FILES
|
||||
engine/client/sys_sdl.c
|
||||
engine/client/snd_al.c
|
||||
|
@ -347,7 +353,7 @@ ELSEIF(1) #SDL
|
|||
)
|
||||
|
||||
SET(FTESV_DEFINES FTE_SDL)
|
||||
SET(FTESV_LIBS ${FTESV_LIBS} m ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
|
||||
SET(FTESV_LIBS ${FTESV_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
|
||||
|
||||
IF(WIN32)
|
||||
SET(FTE_LIBS ${FTE_LIBS} wsock32 gdi32 ole32)
|
||||
|
@ -740,7 +746,7 @@ ELSE()
|
|||
SET_TARGET_PROPERTIES(bullet PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(bullet PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(bullet PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(bullet m ${BULLET_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(bullet ${SYS_LIBS} ${BULLET_LIBRARIES})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} bullet)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
@ -781,7 +787,6 @@ ELSE()
|
|||
SET_TARGET_PROPERTIES(iqmtool PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}")
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} iqmtool)
|
||||
|
||||
IF(NOT WIN32)
|
||||
ADD_EXECUTABLE(imgtool
|
||||
engine/client/image.c
|
||||
imgtool.c
|
||||
|
@ -789,7 +794,6 @@ ELSE()
|
|||
SET_TARGET_PROPERTIES(imgtool PROPERTIES COMPILE_DEFINITIONS "IMGTOOL;${FTE_LIB_DEFINES};${FTE_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(imgtool ${FTE_LIBS} )
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} imgtool)
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(qtv
|
||||
fteqtv/netchan.c
|
||||
|
@ -811,9 +815,9 @@ ELSE()
|
|||
)
|
||||
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}")
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(qtv ws2_32 winmm)
|
||||
TARGET_LINK_LIBRARIES(qtv ws2_32 winmm ${SYS_LIBS})
|
||||
ELSE()
|
||||
TARGET_LINK_LIBRARIES(qtv m)
|
||||
TARGET_LINK_LIBRARIES(qtv ${SYS_LIBS})
|
||||
ENDIF()
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} qtv)
|
||||
|
||||
|
@ -862,7 +866,7 @@ ELSE()
|
|||
engine/qclib/qcd_main.c
|
||||
)
|
||||
SET_TARGET_PROPERTIES(fteqcc PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(fteqcc ${FTEQCC_LIBS} m)
|
||||
TARGET_LINK_LIBRARIES(fteqcc ${FTEQCC_LIBS} ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} fteqcc)
|
||||
|
||||
IF(${WIN32})
|
||||
|
@ -934,7 +938,7 @@ ADD_LIBRARY(qi MODULE
|
|||
SET_TARGET_PROPERTIES(qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(qi PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(qi PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(qi m)
|
||||
TARGET_LINK_LIBRARIES(qi ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} qi)
|
||||
|
||||
#ODE Physics library plugin
|
||||
|
@ -950,7 +954,7 @@ IF (LIBODE_INCLUDE_DIR)
|
|||
SET_TARGET_PROPERTIES(ode PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;ODE_STATIC")
|
||||
SET_TARGET_PROPERTIES(ode PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(ode PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(ode m ${LIBODE_LIBRARY})
|
||||
TARGET_LINK_LIBRARIES(ode ${SYS_LIBS} ${LIBODE_LIBRARY})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} ode)
|
||||
ENDIF()
|
||||
|
||||
|
@ -965,7 +969,7 @@ ADD_LIBRARY(ezhud MODULE
|
|||
SET_TARGET_PROPERTIES(ezhud PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(ezhud PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(ezhud PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(ezhud m)
|
||||
TARGET_LINK_LIBRARIES(ezhud ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} ezhud)
|
||||
|
||||
#NameMaker string generation plugin
|
||||
|
@ -976,7 +980,7 @@ ADD_LIBRARY(namemaker MODULE
|
|||
SET_TARGET_PROPERTIES(namemaker PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(namemaker PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(namemaker PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(namemaker m)
|
||||
TARGET_LINK_LIBRARIES(namemaker ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} namemaker)
|
||||
|
||||
#Terrain Generation plugin
|
||||
|
@ -987,7 +991,7 @@ ADD_LIBRARY(terrorgen MODULE
|
|||
SET_TARGET_PROPERTIES(terrorgen PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(terrorgen PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(terrorgen PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(terrorgen m)
|
||||
TARGET_LINK_LIBRARIES(terrorgen ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} terrorgen)
|
||||
|
||||
#IRC client plugin
|
||||
|
@ -998,7 +1002,7 @@ ADD_LIBRARY(irc MODULE
|
|||
SET_TARGET_PROPERTIES(irc PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_REVISON};${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(irc PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(irc PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(irc m)
|
||||
TARGET_LINK_LIBRARIES(irc ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} irc)
|
||||
|
||||
#model formats plugin
|
||||
|
@ -1011,7 +1015,7 @@ ADD_LIBRARY(models MODULE
|
|||
SET_TARGET_PROPERTIES(models PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(models PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(models PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(models m)
|
||||
TARGET_LINK_LIBRARIES(models ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} models)
|
||||
|
||||
IF(0)
|
||||
|
@ -1027,7 +1031,7 @@ IF(0)
|
|||
SET_TARGET_PROPERTIES(x11sv PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(x11sv PROPERTIES PREFIX "fteplug_")
|
||||
SET_TARGET_PROPERTIES(x11sv PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(x11sv m)
|
||||
TARGET_LINK_LIBRARIES(x11sv ${SYS_LIBS})
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} x11sv)
|
||||
ENDIF()
|
||||
|
||||
|
@ -1050,7 +1054,7 @@ IF((AVFORMAT_INCLUDE_DIR) AND (AVSWSCALE_INCLUDE_DIR))
|
|||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(ffmpeg PUBLIC ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVSWSCALE_INCLUDE_DIR})
|
||||
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
TARGET_LINK_LIBRARIES(ffmpeg m ${AVFORMAT_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${AVSWSCALE_LIBRARY})
|
||||
TARGET_LINK_LIBRARIES(ffmpeg ${SYS_LIBS} ${AVFORMAT_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${AVSWSCALE_LIBRARY})
|
||||
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES PREFIX "fteplug_")
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} ffmpeg)
|
||||
|
@ -1076,7 +1080,7 @@ IF(NOT ANDROID)
|
|||
SET_TARGET_PROPERTIES(xmpp PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
||||
IF(${WIN32})
|
||||
ELSE()
|
||||
TARGET_LINK_LIBRARIES(xmpp m resolv)
|
||||
TARGET_LINK_LIBRARIES(xmpp ${SYS_LIBS} resolv)
|
||||
ENDIF()
|
||||
SET(INSTALLTARGS ${INSTALLTARGS} xmpp)
|
||||
ENDIF()
|
||||
|
|
|
@ -433,7 +433,9 @@ typedef struct botlib_export_s
|
|||
} botlib_export_t;
|
||||
|
||||
//linking of bot library
|
||||
#ifndef EXTERNALBOTLIB
|
||||
botlib_export_t *QDECL GetBotLibAPI( int apiVersion, botlib_import_t *import );
|
||||
#endif
|
||||
|
||||
/* Library variables:
|
||||
|
||||
|
|
|
@ -3870,15 +3870,15 @@ nextchan:
|
|||
}
|
||||
struct xcf_heirachy_s
|
||||
{
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t bpp;
|
||||
quint32_t width;
|
||||
quint32_t height;
|
||||
quint32_t bpp;
|
||||
qbyte *data;
|
||||
};
|
||||
static struct xcf_heirachy_s XCF_ReadHeirachy(struct xcf_s *f)
|
||||
{
|
||||
struct xcf_heirachy_s ctx;
|
||||
uint32_t x, y, lw, lh;
|
||||
quint32_t x, y, lw, lh;
|
||||
qofs_t ofs, tofs;
|
||||
if (!f->offset)
|
||||
{
|
||||
|
@ -3927,8 +3927,8 @@ static struct xcf_heirachy_s XCF_ReadChannel(struct xcf_s *f)
|
|||
{
|
||||
struct xcf_heirachy_s h;
|
||||
char name[1024];
|
||||
uint32_t width = XCF_Read32(f);
|
||||
uint32_t height = XCF_Read32(f);
|
||||
quint32_t width = XCF_Read32(f);
|
||||
quint32_t height = XCF_Read32(f);
|
||||
unsigned int proptype, propsize;
|
||||
XCF_ReadString(f, name, sizeof(name));
|
||||
for(;;)
|
||||
|
@ -3991,11 +3991,11 @@ static qboolean XCF_CombineLayer(struct xcf_s *f)
|
|||
unsigned int proptype, propsize;
|
||||
size_t width, height, type, heirachyoffset, layermaskoffset;
|
||||
char name[1024];
|
||||
uint32_t applylayermask = false;
|
||||
int32_t blendmode = 0;
|
||||
quint32_t applylayermask = false;
|
||||
qint32_t blendmode = 0;
|
||||
qboolean unsupported = false;
|
||||
uint32_t x,y, ofsx=0,ofsy=0;
|
||||
uint32_t visible = true;
|
||||
quint32_t x,y, ofsx=0,ofsy=0;
|
||||
quint32_t visible = true;
|
||||
float opacity = 1;
|
||||
width = XCF_Read32(f);
|
||||
height = XCF_Read32(f);
|
||||
|
@ -9943,7 +9943,7 @@ static void Image_Decode_ASTC_HDR_HF_Block(qbyte *fte_restrict in, pixel64_t *ft
|
|||
/*static unsigned int RGB16F_to_E5BGR9(unsigned short Cr, unsigned short Cg, unsigned short Cb)
|
||||
{
|
||||
int Re,Ge,Be, Rex,Gex,Bex, Xm, Xe;
|
||||
uint32_t rshift, gshift, bshift, expo;
|
||||
quint32_t rshift, gshift, bshift, expo;
|
||||
int Rm, Gm, Bm;
|
||||
|
||||
if( Cr > 0x7c00 ) Cr = 0; else if( Cr == 0x7c00 ) Cr = 0x7bff;
|
||||
|
|
|
@ -254,13 +254,15 @@ extern "C" {
|
|||
|
||||
|
||||
#ifdef _WIN32
|
||||
#if (_MSC_VER >= 1400)
|
||||
//with MSVC 8, use MS extensions
|
||||
#if (_MSC_VER >= 1900)
|
||||
// MSVC 14 has standardized snprintf functions, hurrah!
|
||||
#elif (_MSC_VER >= 1400)
|
||||
//with MSVC 8, use MS extensions. return values are still wrong.
|
||||
#define snprintf linuxlike_snprintf_vc8
|
||||
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
|
||||
#define vsnprintf(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d)
|
||||
#else
|
||||
//msvc crap
|
||||
//msvc crap. return values are wrong but at least we can null terminate it safely.
|
||||
#define snprintf linuxlike_snprintf
|
||||
int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
|
||||
#define vsnprintf linuxlike_vsnprintf
|
||||
|
@ -272,6 +274,13 @@ extern "C" {
|
|||
//but mingw has some defines elsewhere and makes gcc moan
|
||||
#define _vsnprintf unsafe_vsnprintf
|
||||
#define _snprintf unsafe_snprintf
|
||||
|
||||
#ifndef strcasecmp
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
#ifndef strncasecmp
|
||||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1528,7 +1528,6 @@ void Sys_Init (void)
|
|||
{
|
||||
// LARGE_INTEGER PerformanceFreq;
|
||||
// unsigned int lowpart, highpart;
|
||||
OSVERSIONINFO vinfo;
|
||||
|
||||
Sys_QueryDesktopParameters();
|
||||
|
||||
|
@ -1594,11 +1593,15 @@ void Sys_Init (void)
|
|||
// NT gets 18ms resolution
|
||||
timeBeginPeriod( 1 );
|
||||
|
||||
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
|
||||
|
||||
#if _MSC_VER >= 1600 //msvc2010 runtime does not work on 9x any more. get rid of the deprecation warnings in later versions.
|
||||
WinNT = true;
|
||||
|
||||
qwinvermaj = 6; //Hack: assume 6.2 (aka win8). this will block 16bit colour depths.
|
||||
qwinvermin = 2;
|
||||
#else
|
||||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
|
||||
if (!GetVersionEx (&vinfo))
|
||||
Sys_Error ("Couldn't get OS info");
|
||||
|
||||
|
@ -1612,10 +1615,11 @@ void Sys_Init (void)
|
|||
WinNT = true;
|
||||
else
|
||||
WinNT = false;
|
||||
#endif
|
||||
|
||||
qwinvermaj = vinfo.dwMajorVersion;
|
||||
qwinvermin = vinfo.dwMinorVersion;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4923,6 +4923,11 @@ static void COM_Version_f (void)
|
|||
else if (_MSC_VER == 1400) { Con_Printf("Visual C++ 2005, version 8.0\n"); }
|
||||
else if (_MSC_VER == 1500) { Con_Printf("Visual C++ 2008, version 9.0\n"); }
|
||||
else if (_MSC_VER == 1600) { Con_Printf("Visual C++ 2010, version 10.0\n"); }
|
||||
else if (_MSC_VER == 1700) { Con_Printf("Visual C++ 2012, version 11.0\n"); }
|
||||
else if (_MSC_VER == 1800) { Con_Printf("Visual C++ 2013, version 12.0\n"); }
|
||||
else if (_MSC_VER == 1900) { Con_Printf("Visual C++ 2015, version 14.0\n"); }
|
||||
else if (_MSC_VER >= 1910 && _MSC_VER < 1920) { Con_Printf("Visual C++ 2017, version 14.1x\n"); }
|
||||
else if (_MSC_VER >= 1920 && _MSC_VER < 1930) { Con_Printf("Visual C++ 2019, version 14.2x\n"); }
|
||||
else
|
||||
{
|
||||
#ifdef _MSC_BUILD
|
||||
|
|
|
@ -95,7 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 1310
|
||||
#if _MSC_VER >= 1900
|
||||
// MSVC 14 supports these
|
||||
#elif _MSC_VER >= 1310
|
||||
#define strtoull _strtoui64
|
||||
#define strtoll _strtoi64
|
||||
#else
|
||||
|
|
|
@ -329,7 +329,7 @@ qboolean D3D11_LoadTextureMips(image_t *tex, const struct pendingtextureinfo *mi
|
|||
}
|
||||
else
|
||||
{
|
||||
subresdesc = alloca(tdesc.ArraySize*mips->mipcount);
|
||||
subresdesc = alloca(tdesc.ArraySize*mips->mipcount*sizeof(*subresdesc));
|
||||
for (layer = 0; layer < tdesc.ArraySize; layer++)
|
||||
{
|
||||
for (i = 0; i < mips->mipcount; i++)
|
||||
|
|
|
@ -226,7 +226,7 @@ extern QCC_opcode_t pr_opcodes[]; // sized by initialization
|
|||
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#define Q_vsnprintf _vsnprintf
|
||||
#else
|
||||
#define Q_vsnprintf vsnprintf
|
||||
|
|
|
@ -25,31 +25,27 @@
|
|||
#endif
|
||||
|
||||
#ifdef __MINGW32_VERSION
|
||||
#define MINGW
|
||||
#define MINGW
|
||||
#endif
|
||||
|
||||
#define progfuncs qccprogfuncs
|
||||
extern progfuncs_t *qccprogfuncs;
|
||||
|
||||
#ifndef _WIN32
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER //ffs
|
||||
#define strtoull _strtoui64
|
||||
#ifndef PRIxPTR
|
||||
#define PRIxPTR "Ix"
|
||||
#endif
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#define strtoull _strtoui64
|
||||
#ifndef PRIxPTR
|
||||
#define PRIxPTR "Ix"
|
||||
#endif
|
||||
#else
|
||||
#ifndef PRIxPTR
|
||||
#define PRIxPTR "Ix"
|
||||
#endif
|
||||
#include <inttypes.h>
|
||||
#ifndef PRIxPTR
|
||||
#define PRIxPTR "p"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STRINGIFY
|
||||
#define STRINGIFY2(s) #s
|
||||
#define STRINGIFY(s) STRINGIFY2(s)
|
||||
#define STRINGIFY2(s) #s
|
||||
#define STRINGIFY(s) STRINGIFY2(s)
|
||||
#endif
|
||||
|
||||
void *qccHunkAlloc(size_t mem);
|
||||
|
|
|
@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include <stdio.h>
|
||||
/*work around fucked MSVC functions. we use our own for these*/
|
||||
#if _MSC_VER >= 1300
|
||||
#if _MSC_VER >= 1300 && _MSC_VER < 1900
|
||||
#include <string.h>
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
@ -70,8 +70,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifdef IPPROTO_IPV6
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#define IPPROTO_IPV6
|
||||
#define IPPROTO_IPV6 41
|
||||
#ifndef EAI_NONAME
|
||||
#define EAI_NONAME 8
|
||||
#endif
|
||||
struct ip6_scope_id
|
||||
{
|
||||
union
|
||||
|
|
|
@ -374,6 +374,7 @@ static enum uploadfmt ImgTool_ASTCToLDR(uploadfmt_t fmt)
|
|||
return fmt;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
static void FS_MakeTempName(char *out, size_t outsize, char *prefix, char *suffix)
|
||||
{
|
||||
|
@ -1040,6 +1041,7 @@ static void FileList_Add(struct filelist_s *list, char *fname)
|
|||
#ifdef _WIN32
|
||||
static void ImgTool_TreeScan(struct filelist_s *list, const char *basepath, const char *subpath)
|
||||
{
|
||||
(void)FileList_Add;
|
||||
Con_Printf("ImgTool_TreeScan not implemented on windows.\n");
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -33,8 +33,6 @@ extern pluginputfuncs_t *inputfuncs;
|
|||
#define Q_atoi atoi
|
||||
#define strlcpy Q_strlcpy
|
||||
#define strlcat Q_strlcat
|
||||
#undef snprintf
|
||||
#define snprintf Q_snprintf
|
||||
|
||||
#undef mpic_t
|
||||
#define mpic_t void
|
||||
|
|
|
@ -104,7 +104,7 @@ char *Plug_Info_ValueForKey (const char *s, const char *key, char *out, size_t o
|
|||
return oout;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 2015
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
int Q_vsnprintf(char *buffer, size_t maxlen, const char *format, va_list argptr)
|
||||
{
|
||||
int r = _vsnprintf (buffer, maxlen-1, format, argptr);
|
||||
|
@ -174,7 +174,7 @@ int QDECL linuxlike_vsnprintf(char *buffer, int size, const char *format, va_lis
|
|||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#elif (_MSC_VER < 1900)
|
||||
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
# define strcasecmp stricmp
|
||||
# define strncasecmp strnicmp
|
||||
# endif
|
||||
# if defined(_MSC_VER) && _MSC_VER >= 1900
|
||||
# define Q_vsnprintf vsnprintf
|
||||
# define Q_snprintf snprintf
|
||||
# endif
|
||||
#else
|
||||
# define stricmp strcasecmp
|
||||
# define strnicmp strncasecmp
|
||||
|
|
Loading…
Reference in a new issue