2005-03-09 13:56:02 +01:00
|
|
|
// convenient type aliases (shorter than uintN_t from stdint.h)
|
2004-06-01 19:34:12 +02:00
|
|
|
|
2003-11-03 17:22:45 +01:00
|
|
|
#ifndef __TYPES_H__
|
|
|
|
#define __TYPES_H__
|
|
|
|
|
2005-03-09 13:56:02 +01:00
|
|
|
#include "posix_types.h"
|
2003-11-13 18:18:48 +01:00
|
|
|
|
2003-11-03 17:22:45 +01:00
|
|
|
// defines instead of typedefs so we can #undef conflicting decls
|
|
|
|
|
2004-06-02 17:31:55 +02:00
|
|
|
// Workaround: GCC won't parse constructor-casts with multi-word types, while
|
|
|
|
// visual studio will. Define uint/long to a namespaced one-word typedef.
|
|
|
|
typedef unsigned long PS_ulong;
|
|
|
|
typedef unsigned int PS_uint;
|
|
|
|
#define ulong PS_ulong
|
|
|
|
#define uint PS_uint
|
2003-11-13 18:18:48 +01:00
|
|
|
|
2004-06-01 19:34:12 +02:00
|
|
|
#define i8 int8_t
|
|
|
|
#define i16 int16_t
|
|
|
|
#define i32 int32_t
|
|
|
|
#define i64 int64_t
|
2003-11-13 18:18:48 +01:00
|
|
|
|
2004-06-01 19:34:12 +02:00
|
|
|
#define u8 uint8_t
|
|
|
|
#define u16 uint16_t
|
|
|
|
#define u32 uint32_t
|
|
|
|
#define u64 uint64_t
|
2003-11-13 18:18:48 +01:00
|
|
|
|
|
|
|
|
2004-06-01 19:34:12 +02:00
|
|
|
// the standard only guarantees 16 bits.
|
|
|
|
// we use this for memory offsets and ranges, so it better be big enough.
|
2005-09-30 02:59:42 +02:00
|
|
|
#if defined(SIZE_MAX) && SIZE_MAX < 0xFFFFFFFF
|
2005-03-09 13:56:02 +01:00
|
|
|
# error "check size_t and SIZE_MAX - too small?"
|
2004-06-01 19:34:12 +02:00
|
|
|
#endif
|
2003-11-03 17:22:45 +01:00
|
|
|
|
2005-12-11 23:23:55 +01:00
|
|
|
enum LibError;
|
|
|
|
|
2003-11-03 17:22:45 +01:00
|
|
|
#endif // #ifndef __TYPES_H__
|