diff options
-rw-r--r-- | glpong.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -168,6 +168,8 @@ GLPong_HandleEvents() { static INLINE unsigned int NextPow2(unsigned int value) { +#if (defined __i386__ || defined __amd64__ || defined __x86_64__) \ + && (defined __GNUC__) unsigned int x; __asm( "dec %1 \n\t" /* so that if the number is a power of @@ -179,6 +181,12 @@ NextPow2(unsigned int value) { : "=r" (x) : "c" (value) ); +#else + unsigned int x = 0; + while (x < value) { + x *= 2; + } +#endif return x; } |