mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-02 22:11:32 +00:00
move YQ2_ALIGNAS_* to shared.h
so it's also available in game/
This commit is contained in:
parent
b3bb114ae4
commit
0ad5c73239
2 changed files with 15 additions and 16 deletions
|
@ -53,22 +53,6 @@
|
|||
#define CFGDIR ".yq2"
|
||||
#endif
|
||||
|
||||
// stuff to align variables/arrays
|
||||
#if __STDC_VERSION__ >= 201112L // C11 or newer
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE) _Alignas(SIZE)
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE) _Alignas(TYPE)
|
||||
#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)) ))
|
||||
#elif defined(_MSC_VER)
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE) __declspec( align(SIZE) )
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE) __declspec( align( __alignof(TYPE) ) )
|
||||
#else
|
||||
#warning "Please add a case for your compiler here to align correctly"
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE)
|
||||
#endif
|
||||
|
||||
|
||||
/* ================================================================== */
|
||||
|
||||
typedef struct sizebuf_s
|
||||
|
|
|
@ -53,6 +53,21 @@ typedef unsigned char byte;
|
|||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
// stuff to align variables/arrays
|
||||
#if __STDC_VERSION__ >= 201112L // C11 or newer
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE) _Alignas(SIZE)
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE) _Alignas(TYPE)
|
||||
#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)) ))
|
||||
#elif defined(_MSC_VER)
|
||||
#define YQ2_ALIGNAS_SIZE(SIZE) __declspec( align(SIZE) )
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE) __declspec( align( __alignof(TYPE) ) )
|
||||
#else
|
||||
#warning "Please add a case for your compiler here to align correctly"
|
||||
#define YQ2_ALIGNAS_TYPE(TYPE)
|
||||
#endif
|
||||
|
||||
/* angle indexes */
|
||||
#define PITCH 0 /* up / down */
|
||||
#define YAW 1 /* left / right */
|
||||
|
|
Loading…
Reference in a new issue