From 409b363667f49feecb7bb22a50c9cdce627d4f5b Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 2 Aug 2015 08:50:27 +0000 Subject: [PATCH] Pragma fuckery. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5317 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/pragmas.h | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index 099c39a1c..3fa235293 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -89,7 +89,7 @@ skip: return libdivide_s32_do(n, dptr); } #else -static inline uint32_t divideu32(uint32_t n, uint32_t d) { return n / d; } +FORCE_INLINE uint32_t divideu32(uint32_t n, uint32_t d) { return n / d; } static inline int32_t tabledivide64(int64_t n, int32_t d) { @@ -118,7 +118,7 @@ static inline int32_t divscale(int32_t eax, int32_t ebx, int32_t ecx) #endif #define EDUKE32_SCALER_PRAGMA(a) \ - static inline int32_t divscale##a(int32_t eax, int32_t ebx) { return divscale(eax, ebx, a); } + FORCE_INLINE int32_t divscale##a(int32_t eax, int32_t ebx) { return divscale(eax, ebx, a); } EDUKE32_GENERATE_PRAGMAS EDUKE32_SCALER_PRAGMA(32) #undef EDUKE32_SCALER_PRAGMA @@ -128,7 +128,7 @@ static inline int32_t scale(int32_t eax, int32_t edx, int32_t ecx) return dw(tabledivide64(numer, ecx)); } -static inline void swapptr(void *a, void *b) +FORCE_INLINE void swapptr(void *a, void *b) { intptr_t const t = *(intptr_t*) a; *(intptr_t*) a = *(intptr_t*) b; @@ -162,9 +162,9 @@ static inline void swapptr(void *a, void *b) // #define EDUKE32_SCALER_PRAGMA(a) \ - static inline int32_t mulscale##a(int32_t eax, int32_t edx) { return dw((qw(eax) * qw(edx)) >> by(a)); } \ + FORCE_INLINE int32_t mulscale##a(int32_t eax, int32_t edx) { return dw((qw(eax) * qw(edx)) >> by(a)); } \ \ - static inline int32_t dmulscale##a(int32_t eax, int32_t edx, int32_t esi, int32_t edi) \ + FORCE_INLINE int32_t dmulscale##a(int32_t eax, int32_t edx, int32_t esi, int32_t edi) \ { \ return dw(((qw(eax) * qw(edx)) + (qw(esi) * qw(edi))) >> by(a)); \ } @@ -174,54 +174,54 @@ EDUKE32_GENERATE_PRAGMAS EDUKE32_SCALER_PRAGMA(32) #undef EDUKE32_SCALER_PRAGMA -static inline void swapchar(void *a, void *b) +FORCE_INLINE void swapchar(void *a, void *b) { char const t = *((char *)b); *((char *)b) = *((char *)a); *((char *)a) = t; } -static inline void swapchar2(void *a, void *b, int32_t s) +FORCE_INLINE void swapchar2(void *a, void *b, int32_t s) { swapchar(a, b); swapchar((char *)a + 1, (char *)b + s); } -static inline void swapshort(void *a, void *b) +FORCE_INLINE void swapshort(void *a, void *b) { int16_t const t = *((int16_t *)b); *((int16_t *)b) = *((int16_t *)a); *((int16_t *)a) = t; } -static inline void swaplong(void *a, void *b) +FORCE_INLINE void swaplong(void *a, void *b) { int32_t const t = *((int32_t *)b); *((int32_t *)b) = *((int32_t *)a); *((int32_t *)a) = t; } -static inline void swapfloat(void *a, void *b) +FORCE_INLINE void swapfloat(void *a, void *b) { float const t = *((float *)b); *((float *)b) = *((float *)a); *((float *)a) = t; } -static inline void swap64bit(void *a, void *b) +FORCE_INLINE void swap64bit(void *a, void *b) { uint64_t const t = *((uint64_t *)b); *((uint64_t *)b) = *((uint64_t *)a); *((uint64_t *)a) = t; } -static inline char readpixel(void *s) { return (*((char *)(s))); } -static inline void drawpixel(void *s, char a) { *((char *)(s)) = a; } +FORCE_INLINE char readpixel(void *s) { return (*((char *)(s))); } +FORCE_INLINE void drawpixel(void *s, char a) { *((char *)(s)) = a; } -static inline int32_t klabs(int32_t a) +FORCE_INLINE int32_t klabs(int32_t a) { const uint32_t m = a >> (sizeof(int) * CHAR_BIT - 1); return (a ^ m) - m; } -static inline int32_t ksgn(int32_t a) { return (a > 0) - (a < 0); } +FORCE_INLINE int32_t ksgn(int32_t a) { return (a > 0) - (a < 0); } -static inline int32_t mulscale(int32_t eax, int32_t edx, int32_t ecx) { return dw((qw(eax) * edx) >> by(ecx)); } -static inline int32_t dmulscale(int32_t eax, int32_t edx, int32_t esi, int32_t edi, int32_t ecx) +FORCE_INLINE int32_t mulscale(int32_t eax, int32_t edx, int32_t ecx) { return dw((qw(eax) * edx) >> by(ecx)); } +FORCE_INLINE int32_t dmulscale(int32_t eax, int32_t edx, int32_t esi, int32_t edi, int32_t ecx) { return dw(((qw(eax) * edx) + (qw(esi) * edi)) >> by(ecx)); }