mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 04:52:07 +00:00
Fix build with newer Visual Studio versions
in the __STDC_VERSION__ >= 201112L + _MSC_VER case YQ2_ATTR_INLINE wasn't defined and fixed some indenting in the surrounding code
This commit is contained in:
parent
15adee3b06
commit
89b0ed9f18
1 changed files with 8 additions and 7 deletions
|
@ -59,16 +59,17 @@ typedef unsigned char byte;
|
|||
#define YQ2_ALIGNAS_TYPE(TYPE) _Alignas(TYPE)
|
||||
// must be used as prefix (YQ2_ATTR_NORETURN void bla();)!
|
||||
#define YQ2_ATTR_NORETURN _Noreturn
|
||||
# if defined(__GNUC__)
|
||||
#if defined(__GNUC__)
|
||||
#define YQ2_ATTR_MALLOC __attribute__ ((__malloc__))
|
||||
#define YQ2_ATTR_INLINE __attribute__((always_inline)) inline
|
||||
# elif defined(_MSC_VER)
|
||||
#define YQ2_ATTR_MALLOC __declspec(restrict)
|
||||
# else
|
||||
#elif defined(_MSC_VER)
|
||||
#define YQ2_ATTR_MALLOC __declspec(restrict)
|
||||
#define YQ2_ATTR_INLINE __forceinline
|
||||
#else
|
||||
// no equivalent per see
|
||||
#define YQ2_ATTR_MALLOC
|
||||
#define YQ2_ATTR_INLINE inline
|
||||
# endif
|
||||
#endif
|
||||
#elif defined(__GNUC__) // GCC and clang should support this attribute
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE) __attribute__(( __aligned__(SIZE) ))
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE) __attribute__(( __aligned__(__alignof__(TYPE)) ))
|
||||
|
@ -92,14 +93,14 @@ typedef unsigned char byte;
|
|||
|
||||
// must be used as prefix (YQ2_ATTR_NORETURN void bla();)!
|
||||
#define YQ2_ATTR_NORETURN __declspec(noreturn)
|
||||
#define YQ2_ATTR_MALLOC __declspec(restrict)
|
||||
#define YQ2_ATTR_MALLOC __declspec(restrict)
|
||||
#define YQ2_ATTR_INLINE __forceinline
|
||||
#else
|
||||
#warning "Please add a case for your compiler here to align correctly"
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE)
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE)
|
||||
#define YQ2_ATTR_NORETURN
|
||||
#define YQ2_ATTR_MALLOC
|
||||
#define YQ2_ATTR_MALLOC
|
||||
#define YQ2_ATTR_INLINE inline
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue