test/testtypes.c
author Ryan C. Gordon <icculus@icculus.org>
Thu, 29 Sep 2005 09:43:00 +0000
changeset 1152 51a8702d8ecd
parent 47 45b1c4303f87
child 1154 d93862a3d821
permissions -rw-r--r--
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
activekitten.com.
slouken@0
     1
slouken@0
     2
#include <stdio.h>
slouken@47
     3
#include "SDL_main.h"
slouken@0
     4
#include "SDL_types.h"
slouken@0
     5
slouken@0
     6
int main(int argc, char *argv[])
slouken@0
     7
{
slouken@0
     8
	int error = 0;
slouken@0
     9
	int verbose = 1;
slouken@0
    10
slouken@0
    11
	if ( argv[1] && (strcmp(argv[1], "-q") == 0) )
slouken@0
    12
		verbose = 0;
slouken@0
    13
slouken@0
    14
	if ( sizeof(Uint8) != 1 ) {
slouken@0
    15
		if ( verbose )
slouken@0
    16
			printf("sizeof(Uint8) != 1, instead = %d\n",
slouken@0
    17
								sizeof(Uint8));
slouken@0
    18
		++error;
slouken@0
    19
	}
slouken@0
    20
	if ( sizeof(Uint16) != 2 ) {
slouken@0
    21
		if ( verbose )
slouken@0
    22
			printf("sizeof(Uint16) != 2, instead = %d\n",
slouken@0
    23
								sizeof(Uint16));
slouken@0
    24
		++error;
slouken@0
    25
	}
slouken@0
    26
	if ( sizeof(Uint32) != 4 ) {
slouken@0
    27
		if ( verbose )
slouken@0
    28
			printf("sizeof(Uint32) != 4, instead = %d\n",
slouken@0
    29
								sizeof(Uint32));
slouken@0
    30
		++error;
slouken@0
    31
	}
slouken@0
    32
#ifdef SDL_HAS_64BIT_TYPE
slouken@0
    33
	if ( sizeof(Uint64) != 8 ) {
slouken@0
    34
		if ( verbose )
slouken@0
    35
			printf("sizeof(Uint64) != 8, instead = %d\n",
slouken@0
    36
								sizeof(Uint64));
slouken@0
    37
		++error;
slouken@0
    38
	}
slouken@0
    39
#else
slouken@0
    40
	if ( verbose ) {
slouken@0
    41
		printf("WARNING: No 64-bit datatype on this platform\n");
slouken@0
    42
	}
slouken@0
    43
#endif
slouken@0
    44
	if ( verbose && ! error )
slouken@0
    45
		printf("All data types are the expected size.\n");
slouken@0
    46
slouken@0
    47
	return( error ? 1 : 0 );
slouken@0
    48
}