#include <stdio.h>
#include "SDL.h"
Go to the source code of this file.
§ badsize()
static int badsize |
( |
size_t |
sizeoftype, |
|
|
size_t |
hardcodetype |
|
) |
| |
|
static |
§ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 183 of file testplatform.c.
References SDL_FALSE, SDL_GetPlatform, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogSetPriority, SDL_strcmp, SDL_TRUE, TestAssertions(), TestCPUInfo(), TestEndian(), and TestTypes().
191 if (argv[1] && (
SDL_strcmp(argv[1],
"-q") == 0)) {
#define SDL_LogSetPriority
§ TestAssertions()
Definition at line 154 of file testplatform.c.
References SDL_AssertData::always_ignore, SDL_AssertData::condition, SDL_AssertData::filename, SDL_AssertData::function, SDL_AssertData::linenum, SDL_AssertData::next, SDL_assert, SDL_assert_paranoid, SDL_assert_release, SDL_GetAssertionReport, SDL_Log, and SDL_AssertData::trigger_count.
Referenced by main().
172 SDL_Log(
"'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
const struct SDL_AssertData * next
#define SDL_GetAssertionReport
unsigned int trigger_count
#define SDL_assert_paranoid(condition)
#define SDL_assert(condition)
#define SDL_assert_release(condition)
§ TestCPUInfo()
Definition at line 133 of file testplatform.c.
References SDL_GetCPUCacheLineSize, SDL_GetCPUCount, SDL_GetSystemRAM, SDL_Has3DNow, SDL_HasAltiVec, SDL_HasAVX, SDL_HasMMX, SDL_HasRDTSC, SDL_HasSSE, SDL_HasSSE2, SDL_HasSSE3, SDL_HasSSE41, SDL_HasSSE42, and SDL_Log.
Referenced by main().
#define SDL_GetCPUCacheLineSize
§ TestEndian()
Definition at line 64 of file testplatform.c.
References SDL_BIG_ENDIAN, SDL_BYTEORDER, SDL_LIL_ENDIAN, SDL_Log, SDL_PRIX64, SDL_Swap16(), SDL_Swap32(), and SDL_Swap64().
Referenced by main().
71 Uint32 value32 = 0xEFBEADDE;
72 Uint32 swapped32 = 0xDEADBEEF;
77 value64 |= 0xCDAB3412;
78 swapped64 = 0x1234ABCD;
80 swapped64 |= 0xDEADBEEF;
83 SDL_Log(
"Detected a %s endian machine.\n",
86 if ((*((
char *) &value) >> 4) == 0
x1) {
93 SDL_Log(
"Actually a %s endian machine!\n",
99 SDL_Log(
"Value 16 = 0x%X, swapped = 0x%X\n", value16,
104 SDL_Log(
"16 bit value swapped incorrectly!\n");
109 SDL_Log(
"Value 32 = 0x%X, swapped = 0x%X\n", value32,
114 SDL_Log(
"32 bit value swapped incorrectly!\n");
124 SDL_Log(
"64 bit value swapped incorrectly!\n");
128 return (error ? 1 : 0);
GLuint GLfloat GLfloat GLfloat x1
uint32_t Uint32
An unsigned 32-bit integer type.
uint64_t Uint64
An unsigned 64-bit integer type.
SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x)
GLsizei const GLfloat * value
SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x)
uint16_t Uint16
An unsigned 16-bit integer type.
§ TestTypes()
Definition at line 29 of file testplatform.c.
References badsize(), and SDL_Log.
Referenced by main().
35 SDL_Log(
"sizeof(Uint8) != 1, instead = %u\n",
36 (
unsigned int)
sizeof(
Uint8));
41 SDL_Log(
"sizeof(Uint16) != 2, instead = %u\n",
42 (
unsigned int)
sizeof(
Uint16));
47 SDL_Log(
"sizeof(Uint32) != 4, instead = %u\n",
48 (
unsigned int)
sizeof(
Uint32));
53 SDL_Log(
"sizeof(Uint64) != 8, instead = %u\n",
54 (
unsigned int)
sizeof(
Uint64));
57 if (verbose && !error)
58 SDL_Log(
"All data types are the expected size.\n");
60 return (error ? 1 : 0);
uint32_t Uint32
An unsigned 32-bit integer type.
uint64_t Uint64
An unsigned 64-bit integer type.
uint8_t Uint8
An unsigned 8-bit integer type.
uint16_t Uint16
An unsigned 16-bit integer type.