// ------------------------------------------------------------------------
/*
	author: Jaap Suter
   
	Copyright (C) Electronic Arts Canada Inc. 2002.  All rights reserved.	
*/
// ------------------------------------------------------------------------

/*! 
	\file 
	
	This file implements some standard integral types. It mimmicks some of the 
	typedefs from the Standard C header stdint.h which is not available (unfortunately, otherwise
	I would have used that one) on all platforms. Thus, providing some portability;

	Types are added to this file as they are needed. I am not trying to provide a full replacement for
	stdint.h, just something that looks and feels like it (while still staying in the Reveal namespace
	to make sure I don't introduce future collision).
*/

#ifndef REVEAL_STD_INT_H
#define REVEAL_STD_INT_H

#include <stddef.h> // For size_t

namespace Reveal {

// ------------------------------------------------------------------------
// Definitions for 32 bit x86 windows platforms;
// ------------------------------------------------------------------------
#if   defined _WIN32 && defined _M_IX86

	typedef unsigned int uint32_t;
	typedef	  signed int  int32_t;

// ------------------------------------------------------------------------
// Definitions for the Xbox
// ------------------------------------------------------------------------
#elif defined _XBOX

	typedef unsigned int uint32_t;
	typedef	  signed int  int32_t;

// ------------------------------------------------------------------------
// Definitions for the PS2
// ------------------------------------------------------------------------
#elif defined PS2

	typedef unsigned int uint32_t;
	typedef	  signed int  int32_t;

// ------------------------------------------------------------------------
// Definitions for the Nintendo Gamecube
// ------------------------------------------------------------------------
#elif defined NGC

	typedef unsigned int uint32_t;
	typedef	  signed int  int32_t;

// ------------------------------------------------------------------------
// Make a guess on all other platforms;
// ------------------------------------------------------------------------
#else

	typedef unsigned int uint32_t;
	typedef	  signed int  int32_t;

#endif

// ------------------------------------------------------------------------
// Compile time assertions on the typedefed sizes, based on the assumption 
// that the number of bits for a char is 8, an assumption which isn't likely
// to change any time soon;
// We could use CHAR_BITS instead of 8, but it's not defined on all platforms (as it should be);
// ------------------------------------------------------------------------

//lint -e{514} unusual use of a boolean expression
typedef char uint32_t_must_be_32_bit[ ((sizeof( uint32_t ) == 4) * 2) - 1 ]; 
//lint -e{514} unusual use of a boolean expression
typedef char  int32_t_must_be_32_bit[ ((sizeof(  int32_t ) == 4) * 2) - 1 ];


} // Namespace Reveal;

#endif
