diff --git a/src/common/header/common.h b/src/common/header/common.h index 853a161e..8a609a56 100644 --- a/src/common/header/common.h +++ b/src/common/header/common.h @@ -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 diff --git a/src/common/header/shared.h b/src/common/header/shared.h index 8fca721e..1db9b7c2 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -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 */