mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-23 23:50:40 +00:00
Improve fine-grained GCC and clang version detection, fixing recently introduced build issues. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4685 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
eb8645b6ea
commit
b4ef2d43e8
4 changed files with 35 additions and 17 deletions
|
@ -21,6 +21,27 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define EDUKE32_GCC_PREREQ(major, minor) (major > __GNUC__ || (major == __GNUC__ && minor >= __GNUC_MINOR__))
|
||||||
|
#else
|
||||||
|
# define EDUKE32_GCC_PREREQ(major, minor) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
# define EDUKE32_CLANG_PREREQ(major, minor) (major > __clang_major__ || (major == __clang_major__ && minor >= __clang_minor__))
|
||||||
|
#else
|
||||||
|
# define EDUKE32_CLANG_PREREQ(major, minor) 0
|
||||||
|
#endif
|
||||||
|
#ifndef __has_builtin
|
||||||
|
# define __has_builtin(x) 0 // Compatibility with non-clang compilers.
|
||||||
|
#endif
|
||||||
|
#ifndef __has_feature
|
||||||
|
# define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||||
|
#endif
|
||||||
|
#ifndef __has_extension
|
||||||
|
# define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef UNREFERENCED_PARAMETER
|
#ifndef UNREFERENCED_PARAMETER
|
||||||
#define UNREFERENCED_PARAMETER(x) x=x
|
#define UNREFERENCED_PARAMETER(x) x=x
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,17 +58,19 @@
|
||||||
# define ATTRIBUTE_OPTIMIZE(str)
|
# define ATTRIBUTE_OPTIMIZE(str)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __GNUC__ || defined __clang__
|
#if defined __GNUC__ || __has_builtin(__builtin_expect)
|
||||||
#define EDUKE32_PREDICT_TRUE(x) __builtin_expect(!!(x),1)
|
#define EDUKE32_PREDICT_TRUE(x) __builtin_expect(!!(x),1)
|
||||||
#define EDUKE32_PREDICT_FALSE(x) __builtin_expect(!!(x),0)
|
#define EDUKE32_PREDICT_FALSE(x) __builtin_expect(!!(x),0)
|
||||||
#define EDUKE32_UNREACHABLE_SECTION(...) __builtin_unreachable()
|
|
||||||
#elif _MSC_VER
|
|
||||||
#define EDUKE32_PREDICT_TRUE(x) (x)
|
|
||||||
#define EDUKE32_PREDICT_FALSE(x) (x)
|
|
||||||
#define EDUKE32_UNREACHABLE_SECTION(...) __assume(0)
|
|
||||||
#else
|
#else
|
||||||
#define EDUKE32_PREDICT_TRUE(x) (x)
|
#define EDUKE32_PREDICT_TRUE(x) (x)
|
||||||
#define EDUKE32_PREDICT_FALSE(x) (x)
|
#define EDUKE32_PREDICT_FALSE(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if EDUKE32_GCC_PREREQ(4,5) || __has_builtin(__builtin_unreachable)
|
||||||
|
#define EDUKE32_UNREACHABLE_SECTION(...) __builtin_unreachable()
|
||||||
|
#elif _MSC_VER
|
||||||
|
#define EDUKE32_UNREACHABLE_SECTION(...) __assume(0)
|
||||||
|
#else
|
||||||
#define EDUKE32_UNREACHABLE_SECTION(...) __VA_ARGS__
|
#define EDUKE32_UNREACHABLE_SECTION(...) __VA_ARGS__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -377,6 +400,7 @@ static inline int32_t Blrintf(const float x)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#include <math.h>
|
||||||
#define Blrintf lrintf
|
#define Blrintf lrintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -191,14 +191,8 @@ extern uint32_t vplce[4];
|
||||||
extern int32_t vince[4];
|
extern int32_t vince[4];
|
||||||
extern intptr_t bufplce[4];
|
extern intptr_t bufplce[4];
|
||||||
|
|
||||||
#if !defined __has_extension
|
#if (EDUKE32_GCC_PREREQ(4,7) || __has_extension(attribute_ext_vector_type)) && defined BITNESS64
|
||||||
# define __has_extension(x) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined __GNUC__ && __GNUC_MINOR__ >= 7) || (defined __clang__ && __has_extension(attribute_ext_vector_type))
|
|
||||||
# if defined _WIN64 || defined __amd64 || defined __x86_64 || defined __x86_64__
|
|
||||||
# define USE_VECTOR_EXT
|
# define USE_VECTOR_EXT
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_VECTOR_EXT
|
#ifdef USE_VECTOR_EXT
|
||||||
|
|
|
@ -87,7 +87,7 @@ static __inline int32_t _lrotl(int32_t i, int sh)
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __clang__ && __clang_major__==3
|
#if defined __clang__ && __clang_major__==3 && __clang_minor__==1
|
||||||
// clang 3.1 SVN r149129, assertion failure with inline asm
|
// clang 3.1 SVN r149129, assertion failure with inline asm
|
||||||
# define NOASM 1
|
# define NOASM 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "winbits.h"
|
#include "winbits.h"
|
||||||
|
|
||||||
#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)
|
#ifdef BITNESS64
|
||||||
# define EBACKTRACEDLL "ebacktrace1-64.dll"
|
# define EBACKTRACEDLL "ebacktrace1-64.dll"
|
||||||
#else
|
#else
|
||||||
# define EBACKTRACEDLL "ebacktrace1.dll"
|
# define EBACKTRACEDLL "ebacktrace1.dll"
|
||||||
|
@ -291,6 +291,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.
|
// 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) || (defined __clang__ && __clang_major__ == 3 && __clang_minor__ >= 4)
|
#if (defined __MINGW32__ && EDUKE32_GCC_PREREQ(4,8)) || EDUKE32_CLANG_PREREQ(3,4)
|
||||||
# include "mingw_main.c"
|
# include "mingw_main.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue