]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/builddeps/win64/sdl/include/SDL2/SDL_endian.h
Revert "Update Windows 32 bit SDL build dependency to 2.0.10"
[xonotic/xonotic.git] / misc / builddeps / win64 / sdl / include / SDL2 / SDL_endian.h
index 161c418de9bb7d3d7b343c95830b93b4f327503c..54d5d486d75e1edb14add43ef43d056edb2e4bed 100644 (file)
@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -25,8 +25,8 @@
  *  Functions for reading and writing endian-specific values
  */
 
  *  Functions for reading and writing endian-specific values
  */
 
-#ifndef _SDL_endian_h
-#define _SDL_endian_h
+#ifndef SDL_endian_h_
+#define SDL_endian_h_
 
 #include "SDL_stdinc.h"
 
 
 #include "SDL_stdinc.h"
 
@@ -42,7 +42,7 @@
 #ifdef __linux__
 #include <endian.h>
 #define SDL_BYTEORDER  __BYTE_ORDER
 #ifdef __linux__
 #include <endian.h>
 #define SDL_BYTEORDER  __BYTE_ORDER
-#else /* __linux __ */
+#else /* __linux__ */
 #if defined(__hppa__) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MISPEB__)) || \
 #if defined(__hppa__) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MISPEB__)) || \
@@ -52,7 +52,7 @@
 #else
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN
 #endif
 #else
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN
 #endif
-#endif /* __linux __ */
+#endif /* __linux__ */
 #endif /* !SDL_BYTEORDER */
 
 
 #endif /* !SDL_BYTEORDER */
 
 
@@ -96,6 +96,12 @@ SDL_Swap16(Uint16 x)
   __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
   __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
+#elif defined(__WATCOMC__) && defined(__386__)
+extern _inline Uint16 SDL_Swap16(Uint16);
+#pragma aux SDL_Swap16 = \
+  "xchg al, ah" \
+  parm   [ax]   \
+  modify [ax];
 #else
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 #else
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
@@ -136,6 +142,21 @@ SDL_Swap32(Uint32 x)
   __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
   __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
     return x;
 }
+#elif defined(__WATCOMC__) && defined(__386__)
+extern _inline Uint32 SDL_Swap32(Uint32);
+#ifndef __SW_3 /* 486+ */
+#pragma aux SDL_Swap32 = \
+  "bswap eax"  \
+  parm   [eax] \
+  modify [eax];
+#else  /* 386-only */
+#pragma aux SDL_Swap32 = \
+  "xchg al, ah"  \
+  "ror  eax, 16" \
+  "xchg al, ah"  \
+  parm   [eax]   \
+  modify [eax];
+#endif
 #else
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 #else
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
@@ -234,6 +255,6 @@ SDL_SwapFloat(float x)
 #endif
 #include "close_code.h"
 
 #endif
 #include "close_code.h"
 
-#endif /* _SDL_endian_h */
+#endif /* SDL_endian_h_ */
 
 /* vi: set ts=4 sw=4 expandtab: */
 
 /* vi: set ts=4 sw=4 expandtab: */