typesWin32.h
Engine/source/platform/typesWin32.h
Classes:
Public Defines
__EQUAL_CONST_F() (0.000001)
Constant float epsilon used for F32 comparisons.
FN_CDECL() __cdecl
Calling convention.
NULL() 0
Signals this platfrom is Little Endian.
Public Typedefs
unsigned int
dsize_t
float
F32
Compiler independent 32-bit float.
double
F64
Compiler independent 64-bit float.
signed short
S16
Compiler independent Signed 16-bit short.
signed int
S32
Compiler independent Signed 32-bit integer.
signed long long
S64
Compiler independent Signed 64-bit integer.
signed char
S8
Compiler independent Signed Char.
const char *
StringTableEntry
unsigned short
U16
Compiler independent Unsigned 16-bit short.
unsigned int
U32
Compiler independent Unsigned 32-bit integer.
unsigned long long
U64
Compiler independent Unsigned 64-bit integer.
unsigned char
U8
Compiler independent Unsigned Char.
Public Variables
Constant float 0.5.
Constant float 0.0.
Detailed Description
Public Defines
__EQUAL_CONST_F() (0.000001)
Constant float epsilon used for F32 comparisons.
FN_CDECL() __cdecl
Calling convention.
NULL() 0
PLATFORM_LITTLE_ENDIAN()
Signals this platfrom is Little Endian.
Public Typedefs
typedef unsigned int dsize_t
typedef float F32
Compiler independent 32-bit float.
typedef double F64
Compiler independent 64-bit float.
typedef signed short S16
Compiler independent Signed 16-bit short.
typedef signed int S32
Compiler independent Signed 32-bit integer.
typedef signed long long S64
Compiler independent Signed 64-bit integer.
typedef signed char S8
Compiler independent Signed Char.
typedef const char * StringTableEntry
typedef unsigned short U16
Compiler independent Unsigned 16-bit short.
typedef unsigned int U32
Compiler independent Unsigned 32-bit integer.
typedef unsigned long long U64
Compiler independent Unsigned 64-bit integer.
typedef unsigned char U8
Compiler independent Unsigned Char.
Public Variables
const F32 F32_MAX
Constant Max Limit F32.
const F32 F32_MIN
Constant Min Limit F32.
const F32 Float_2Pi
Constant float 2*PI.
const F32 Float_Half
Constant float 0.5.
const F32 Float_One
Constant float 1.0.
const F32 Float_Pi
Constant float PI.
const F32 Float_Zero
Constant float 0.0.
const S16 S16_MAX
Constant Max Limit S16.
const S16 S16_MIN
Constant Min Limit S16.
const S32 S32_MAX
Constant Max Limit S32.
const S32 S32_MIN
Constant Min Limit S32.
const S8 S8_MAX
Constant Max Limit S8.
const S8 S8_MIN
Constant Min Limit S8.
const U16 U16_MAX
Constant Max Limit U16.
const U32 U32_MAX
Constant Max Limit U32.
const U8 U8_MAX
Constant Max Limit U8.
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _TYPESWIN32_H_ 25#define _TYPESWIN32_H_ 26 27// We have to check this. Since every file will eventually wind up including 28// this header, but not every header includes a windows or system header... 29// 30#ifndef NULL 31#define NULL 0 32#endif 33 34// Let's just have this in a nice central location. Again, since every file 35// will wind up including this file, we can affect compilation most effectively 36// from this location. 37// 38#define PLATFORM_LITTLE_ENDIAN ///< Signals this platfrom is Little Endian 39 40 41#define FN_CDECL __cdecl ///< Calling convention 42 43//------------------------------------------------------------------------------ 44//-------------------------------------- Basic Types... 45 46typedef signed char S8; ///< Compiler independent Signed Char 47typedef unsigned char U8; ///< Compiler independent Unsigned Char 48 49typedef signed short S16; ///< Compiler independent Signed 16-bit short 50typedef unsigned short U16; ///< Compiler independent Unsigned 16-bit short 51 52typedef signed int S32; ///< Compiler independent Signed 32-bit integer 53typedef unsigned int U32; ///< Compiler independent Unsigned 32-bit integer 54 55#ifdef __BORLANDC__ 56typedef signed __int64 S64; ///< Compiler independent Signed 64-bit integer 57typedef unsigned __int64 U64; ///< Compiler independent Unsigned 64-bit integer 58 59#elif defined(__MWERKS__) // This has to go before MSC_VER since CodeWarrior defines MSC_VER too 60typedef signed long long S64; ///< Compiler independent Signed 64-bit integer 61typedef unsigned long long U64; ///< Compiler independent Unsigned 64-bit integer 62 63#elif defined(_MSC_VER) 64typedef signed _int64 S64; ///< Compiler independent Signed 64-bit integer 65typedef unsigned _int64 U64; ///< Compiler independent Unsigned 64-bit integer 66#pragma warning(disable: 4291) // disable warning caused by memory layer... 67#pragma warning(disable: 4996) // turn off "deprecation" warnings 68 69#else 70typedef signed long long S64; ///< Compiler independent Signed 64-bit integer 71typedef unsigned long long U64; ///< Compiler independent Unsigned 64-bit integer 72#endif 73 74typedef float F32; ///< Compiler independent 32-bit float 75typedef double F64; ///< Compiler independent 64-bit float 76 77// size_t is needed to overload new 78// size_t tends to be OS and compiler specific and may need to 79// be if/def'ed in the future 80 81#ifdef _WIN64 82typedef unsigned long long dsize_t; 83#else 84typedef unsigned int dsize_t; 85#endif // _WIN64 86 87typedef const char* StringTableEntry; 88 89/* Platform dependent file date-time structure. The defination of this structure 90 * will likely be different for each OS platform. 91 */ 92struct FileTime 93{ 94 U32 v1; 95 U32 v2; 96}; 97 98//------------------------------------------------------------------------------ 99//-------------------------------------- Type constants... 100#define __EQUAL_CONST_F F32(0.000001) ///< Constant float epsilon used for F32 comparisons 101 102static const F32 Float_One = F32(1.0); ///< Constant float 1.0 103static const F32 Float_Half = F32(0.5); ///< Constant float 0.5 104static const F32 Float_Zero = F32(0.0); ///< Constant float 0.0 105static const F32 Float_Pi = F32(3.14159265358979323846); ///< Constant float PI 106static const F32 Float_2Pi = F32(2.0 * 3.14159265358979323846); ///< Constant float 2*PI 107 108static const S8 S8_MIN = S8(-128); ///< Constant Min Limit S8 109static const S8 S8_MAX = S8(127); ///< Constant Max Limit S8 110static const U8 U8_MAX = U8(255); ///< Constant Max Limit U8 111 112static const S16 S16_MIN = S16(-32768); ///< Constant Min Limit S16 113static const S16 S16_MAX = S16(32767); ///< Constant Max Limit S16 114static const U16 U16_MAX = U16(65535); ///< Constant Max Limit U16 115 116static const S32 S32_MIN = S32(-2147483647 - 1); ///< Constant Min Limit S32 117static const S32 S32_MAX = S32(2147483647); ///< Constant Max Limit S32 118static const U32 U32_MAX = U32(0xffffffff); ///< Constant Max Limit U32 119 120static const F32 F32_MIN = F32(1.175494351e-38F); ///< Constant Min Limit F32 121static const F32 F32_MAX = F32(3.402823466e+38F); ///< Constant Max Limit F32 122 123 124#ifdef _MSC_VER 125#if _MSC_VER < 1700 126#define for if(false) {} else for ///< Hack to work around Microsoft VC's non-C++ compliance on variable scoping 127#endif 128#endif 129 130 131#endif //_NTYPES_H_ 132