Fix errors and warnings with LLVM/clang 3.4 Windows.

git-svn-id: https://svn.eduke32.com/eduke32@4315 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-02-10 10:55:13 +00:00
parent 854c266cf7
commit 8db0c9c729
6 changed files with 16 additions and 11 deletions

View file

@ -356,7 +356,9 @@ endif
# See http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
# for a list of possible UBSan options.
# Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer
CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size
ifneq ($(PLATFORM),WINDOWS)
CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size
endif
ifneq (0,$(RELEASE))
# Debugging disabled

View file

@ -102,7 +102,10 @@ ifeq ($(PLATFORM),WINDOWS)
SDL_FRAMEWORK=1
BUILDCOMMONFLAGS+= -DHAVE_INTTYPES
EXESUFFIX=.exe
BUILDLIBS+= -Wl,--enable-auto-import -mwindows -lmingwex -lcomctl32 -lwinmm $(L_SSP) -lwsock32 -lws2_32 -lshlwapi
BUILDLIBS+= -Wl,--enable-auto-import -lmingwex -lgdi32 -lcomctl32 -lwinmm $(L_SSP) -lwsock32 -lws2_32 -lshlwapi
ifeq (0,$(CLANG))
BUILDLIBS+= -mwindows
endif
#-lshfolder
#BUILDLIBDIRS+= -L$(ENETROOT)
STDCPPLIB:=-lstdc++
@ -228,7 +231,7 @@ ifeq ($(RENDERTYPE),SDL)
BUILDLIBS+= -static
endif
endif
BUILDLIBS+= -l$(SDLNAME)main -l$(SDLNAME) -lmingw32 -limm32 -lole32 -loleaut32 -lwinmm -lversion
BUILDLIBS+= -l$(SDLNAME)main -l$(SDLNAME) -lmingw32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lversion
endif
ifeq (1,$(WITHOUT_GTK))

View file

@ -69,13 +69,13 @@ LUNATIC_EXTERN const int32_t engine_main_arrays_are_static = 0; // for Lunatic
# else
LUNATIC_EXTERN const int32_t engine_main_arrays_are_static = 1;
# endif
#endif
#if MAXSECTORS==MAXSECTORSV8
LUNATIC_EXTERN const int32_t engine_v8 = 1;
#else
LUNATIC_EXTERN const int32_t engine_v8 = 0;
#endif
#endif
#ifdef DEBUGGINGAIDS
float debug1, debug2;

View file

@ -206,6 +206,7 @@ static uint8_t qhufbit0[1<<LOGQHUFSIZ0], qhufbit1[1<<LOGQHUFSIZ1];
#if defined(_MSC_VER) && !defined(NOASM)
#if defined(BIGENDIAN)
static _inline uint32_t bswap(uint32_t a)
{
_asm
@ -214,6 +215,7 @@ static _inline uint32_t bswap(uint32_t a)
bswap eax
}
}
#endif
static _inline int32_t bitrev(int32_t b, int32_t c)
{
@ -270,11 +272,13 @@ static _inline void cpuid(int32_t a, int32_t *s)
#elif defined(__GNUC__) && defined(__i386__) && !defined(NOASM)
#if defined(BIGENDIAN)
static inline uint32_t bswap(uint32_t a)
{
__asm__ __volatile__("bswap %0" : "+r"(a) : : "cc");
return a;
}
#endif
static inline int32_t bitrev(int32_t b, int32_t c)
{
@ -306,10 +310,12 @@ static inline void cpuid(int32_t a, int32_t *s)
#else
#if defined(BIGENDIAN)
static inline uint32_t bswap(uint32_t a)
{
return(((a&0xff0000)>>8) + ((a&0xff00)<<8) + (a<<24) + (a>>24));
}
#endif
static inline int32_t bitrev(int32_t b, int32_t c)
{

View file

@ -195,12 +195,6 @@ int32_t r_parallaxskypanning = 0;
#define MIN_CACHETIME_PRINT 10
static inline int32_t imod(int32_t a, int32_t b)
{
if (a >= 0) return(a%b);
return(((a+1)%b)+b-1);
}
void drawline2d(float x0, float y0, float x1, float y1, char col)
{
float f, dx, dy, fxres, fyres;

View file

@ -283,6 +283,6 @@ int32_t addsearchpath_ProgramFiles(const char *p)
// Workaround for a bug in mingwrt-4.0.0 and up where a function named main() in misc/src/libcrt/gdtoa/qnan.c takes precedence over the proper one in src/libcrt/crt/main.c.
#if defined __MINGW32__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 8
#if (defined __MINGW32__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 8) || (defined __clang__ && __clang_major__ == 3 && __clang_minor__ >= 4)
# include "mingw_main.c"
#endif