annotate Isolated/LGPL/SDL_endian_minimal.h @ 68:492239f6ffc9

Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it. Running this dumps the #defines for me: /usr/local/bin/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-cpp -dM /dev/null (Instructions found from http://annoyingtechnicaldetails.wordpress.com/2012/02/01/which-macros-does-the-android-ndk-gcc-define/) Johnson Lin < arch . jslin - at - gmail . com >
author Eric Wing <ewing . public |-at-| gmail . com>
date Wed, 20 Jun 2012 10:30:47 -0700
parents 71b465ff0622
children
rev   line source
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
1 /*
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
2 Simple DirectMedia Layer
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
3 Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
4
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
5 This software is provided 'as-is', without any express or implied
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
6 warranty. In no event will the authors be held liable for any damages
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
7 arising from the use of this software.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
8
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
9 Permission is granted to anyone to use this software for any purpose,
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
10 including commercial applications, and to alter it and redistribute it
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
11 freely, subject to the following restrictions:
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
12
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
13 1. The origin of this software must not be misrepresented; you must not
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
14 claim that you wrote the original software. If you use this software
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
15 in a product, an acknowledgment in the product documentation would be
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
16 appreciated but is not required.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
17 2. Altered source versions must be plainly marked as such, and must not be
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
18 misrepresented as being the original software.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
19 3. This notice may not be removed or altered from any source distribution.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
20 */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
21
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
22 /**
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
23 * \file SDL_endian.h
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
24 *
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
25 * Functions for reading and writing endian-specific values
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
26 */
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
27
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
28 /*
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
29 Attention: This is a stripped down file of SDL_endian.h for our purposes.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
30 SDL_static_cast and SDL_reinterpret_cast come from SDL_stdinc.h.
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
31 */
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
32
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
33
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
34 #ifndef SDL_endian_minimal_h
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
35 #define SDL_endian_minimal_h
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
36
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
37
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
38 /**
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
39 * \name Cast operators
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
40 *
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
41 * Use proper C++ casts when compiled as C++ to be compatible with the option
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
42 * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
43 */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
44 /*@{*/
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
45 #ifdef __cplusplus
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
46 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
47 #define SDL_static_cast(type, expression) static_cast<type>(expression)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
48 #else
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
49 #define SDL_reinterpret_cast(type, expression) ((type)(expression))
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
50 #define SDL_static_cast(type, expression) ((type)(expression))
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
51 #endif
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
52 /*@}*//*Cast operators*/
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
53
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
54
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
55
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
56 /**
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
57 * \name The two types of endianness
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
58 */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
59 /*@{*/
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
60 #define SDL_LIL_ENDIAN 1234
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
61 #define SDL_BIG_ENDIAN 4321
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
62 /*@}*/
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
63
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
64 #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
65 #ifdef __linux__
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
66 #include <endian.h>
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
67 #define SDL_BYTEORDER __BYTE_ORDER
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
68 #else /* __linux __ */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
69 #if defined(__hppa__) || \
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
70 defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
71 (defined(__MIPS__) && defined(__MISPEB__)) || \
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
72 defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
73 defined(__sparc__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
74
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
75 #define SDL_BYTEORDER SDL_BIG_ENDIAN
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
76 #else
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
77 #define SDL_BYTEORDER SDL_LIL_ENDIAN
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
78 #endif
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
79 #endif /* __linux __ */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
80 #endif /* !SDL_BYTEORDER */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
81
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
82
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
83 #include <stdint.h>
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
84
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
85 /**
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
86 * \file SDL_endian.h
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
87 *
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
88 * Uses inline functions for compilers that support them, and static
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
89 * functions for those that do not. Because these functions become
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
90 * static for compilers that do not support inline functions, this
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
91 * header should only be included in files that actually use them.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
92 */
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
93 #if defined(__GNUC__) && defined(__i386__) && \
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
94 !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
95 static __inline__ uint16_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
96 SDL_Swap16(uint16_t x)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
97 {
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
98 __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
99 return x;
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
100 }
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
101 #elif defined(__GNUC__) && defined(__x86_64__)
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
102 static __inline__ uint16_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
103 SDL_Swap16(uint16_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
104 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
105 __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
106 return x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
107 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
108 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
109 static __inline__ uint16_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
110 SDL_Swap16(uint16_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
111 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
112 int result;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
113
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
114 __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
115 return (uint16_t)result;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
116 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
117 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
118 static __inline__ uint16_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
119 SDL_Swap16(uint16_t x)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
120 {
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
121 __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
122 return x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
123 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
124 #else
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
125 static __inline__ uint16_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
126 SDL_Swap16(uint16_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
127 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
128 return SDL_static_cast(uint16_t, ((x << 8) | (x >> 8)));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
129 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
130 #endif
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
131
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
132 #if defined(__GNUC__) && defined(__i386__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
133 static __inline__ uint32_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
134 SDL_Swap32(uint32_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
135 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
136 __asm__("bswap %0": "=r"(x):"0"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
137 return x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
138 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
139 #elif defined(__GNUC__) && defined(__x86_64__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
140 static __inline__ uint32_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
141 SDL_Swap32(uint32_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
142 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
143 __asm__("bswapl %0": "=r"(x):"0"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
144 return x;
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
145 }
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
146 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
147 static __inline__ uint32_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
148 SDL_Swap32(uint32_t x)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
149 {
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
150 uint32_t result;
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
151
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
152 __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
153 __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
154 __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
155 return result;
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
156 }
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
157 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
158 static __inline__ uint32_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
159 SDL_Swap32(uint32_t x)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
160 {
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
161 __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
162 return x;
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
163 }
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
164 #else
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
165 static __inline__ uint32_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
166 SDL_Swap32(uint32_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
167 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
168 return SDL_static_cast(uint32_t, ((x << 24) | ((x << 8) & 0x00FF0000) |
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
169 ((x >> 8) & 0x0000FF00) | (x >> 24)));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
170 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
171 #endif
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
172
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
173 #if defined(__GNUC__) && defined(__i386__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
174 static __inline__ uint64_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
175 SDL_Swap64(uint64_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
176 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
177 union
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
178 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
179 struct
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
180 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
181 uint32_t a, b;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
182 } s;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
183 uint64_t u;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
184 } v;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
185 v.u = x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
186 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
187 "1"(v.s.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
188 b));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
189 return v.u;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
190 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
191 #elif defined(__GNUC__) && defined(__x86_64__)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
192 static __inline__ uint64_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
193 SDL_Swap64(uint64_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
194 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
195 __asm__("bswapq %0": "=r"(x):"0"(x));
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
196 return x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
197 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
198 #else
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
199 static __inline__ uint64_t
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
200 SDL_Swap64(uint64_t x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
201 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
202 uint32_t hi, lo;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
203
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
204 /* Separate into high and low 32-bit values and swap them */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
205 lo = SDL_static_cast(uint32_t, x & 0xFFFFFFFF);
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
206 x >>= 32;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
207 hi = SDL_static_cast(uint32_t, x & 0xFFFFFFFF);
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
208 x = SDL_Swap32(lo);
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
209 x <<= 32;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
210 x |= SDL_Swap32(hi);
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
211 return (x);
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
212 }
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
213 #endif
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
214
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
215
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
216 static __inline__ float
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
217 SDL_SwapFloat(float x)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
218 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
219 union
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
220 {
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
221 float f;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
222 uint32_t ui32;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
223 } swapper;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
224 swapper.f = x;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
225 swapper.ui32 = SDL_Swap32(swapper.ui32);
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
226 return swapper.f;
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
227 }
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
228
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
229
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
230 /**
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
231 * \name Swap to native
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
232 * Byteswap item from the specified endianness to the native endianness.
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
233 */
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
234 /*@{*/
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
235 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
236 #define SDL_SwapLE16(X) (X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
237 #define SDL_SwapLE32(X) (X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
238 #define SDL_SwapLE64(X) (X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
239 #define SDL_SwapFloatLE(X) (X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
240 #define SDL_SwapBE16(X) SDL_Swap16(X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
241 #define SDL_SwapBE32(X) SDL_Swap32(X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
242 #define SDL_SwapBE64(X) SDL_Swap64(X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
243 #define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
244 #else
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
245 #define SDL_SwapLE16(X) SDL_Swap16(X)
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
246 #define SDL_SwapLE32(X) SDL_Swap32(X)
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
247 #define SDL_SwapLE64(X) SDL_Swap64(X)
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
248 #define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
249 #define SDL_SwapBE16(X) (X)
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
250 #define SDL_SwapBE32(X) (X)
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
251 #define SDL_SwapBE64(X) (X)
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
252 #define SDL_SwapFloatBE(X) (X)
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
253 #endif
68
492239f6ffc9 Changed SDL_endian_minimal.h to copy from SDL 1.3 which is under the zlib license instead of LGPL. Thanks to Johnson Lin for contributing this. I made a few changes. It seems the Android stuff will hit the __linux define so I could remove the Android specific case. I also needed to copy the SDL_static_cast (and SDL_reinterpret_cast) from SDL_stdinc.h because some of the macros depend on it.
Eric Wing <ewing . public |-at-| gmail . com>
parents: 38
diff changeset
254 /*@}*//*Swap to native*/
38
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
255
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
256
71b465ff0622 Added support files.
Eric Wing <ewing@anscamobile.com>
parents:
diff changeset
257 #endif // SDL_endian_minimal_h