Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# osclconfig_limits_typedefs.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //     O S C L C O N F I G_ L I M I T S _ T Y P E D E F S
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00008
    00017 #ifndef OSCLCONFIG_LIMITS_TYPEDEFS_H_INCLUDED
    00018 #define OSCLCONFIG_LIMITS_TYPEDEFS_H_INCLUDED
    00019
    00020
    00021 #include <limits.h>
    00022
    00023 // determine if char is signed or unsigned
    00024 #if ( CHAR_MIN == 0 )
    00025 #define OSCL_CHAR_IS_UNSIGNED 1
    00026 #define OSCL_CHAR_IS_SIGNED   0
    00027 #elif ( CHAR_MIN == SCHAR_MIN )
    00028 #define OSCL_CHAR_IS_UNSIGNED 0
    00029 #define OSCL_CHAR_IS_SIGNED   1
    00030 #else
    00031 #error "Cannot determine if char is signed or unsigned"
    00032 #endif
    00033
    00034
    00035 #if ( (CHAR_MAX == 255) || (CHAR_MAX == 127) )
    00036 typedef signed char int8;
    00037 typedef unsigned char uint8;
    00038 #else
    00039 #error "Cannot determine an 8-bit interger type"
    00040 #endif
    00041
    00042
    00043 #if ( SHRT_MAX == 32767 )
    00044 typedef short int16;
    00045 typedef unsigned short uint16;
    00046
    00047 #elif ( INT_MAX == 32767 )
    00048 typedef int int16;
    00049 typedef unsigned int uint16;
    00050
    00051 #else
    00052 #error "Cannot determine 16-bit integer type"
    00053 #endif
    00054
    00055
    00056
    00057 #if ( INT_MAX == 2147483647 )
    00058 typedef int int32;
    00059 typedef unsigned int uint32;
    00060
    00061 #elif ( LONG_MAX == 2147483647 )
    00062 typedef long int32;
    00063 typedef unsigned long uint32;
    00064
    00065 #else
    00066 #error "Cannot determine 32-bit integer type"
    00067 #endif
    00068
    00069
    00070
    00071 #endif