sipxportlib  Version 3.3
OsIntTypes.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2007 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 // Author: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _OsIntTypes_h_
14 #define _OsIntTypes_h_
15 
26 // Define these macros to include support for minimum/maximum constants
27 // and constant macros, if they have not already been defined on the compiler
28 // command line by the build system.
29 #ifndef __STDC_LIMIT_MACROS
30 #define __STDC_LIMIT_MACROS
31 #endif
32 #ifndef __STDC_CONSTANT_MACROS
33 #define __STDC_CONSTANT_MACROS
34 #endif
35 #ifndef __STDC_FORMAT_MACROS
36 #define __STDC_FORMAT_MACROS
37 #endif
38 
39 #ifdef _MSC_VER
40 #if (_MSC_VER < 1900)
41 // Microsoft Visual Studio C/C++ compiler
42 # include <os/msinttypes/inttypes.h>
43 #else
44 # include <limits.h>
45 # include <inttypes.h>
46 #endif
47 
48 #elif __GNUC__
49 // GNU C/C++ compiler
50 # include <limits.h>
51 # include <inttypes.h>
52 
53 #else
54 # error Unknown compiler. Check does your compiler support C99 "inttypes.h" and edit this file.
55 #endif
56 
57 /* Test to see whether this file got included soon enough - if the __STDC macros
58  * weren't defined on the compiler command line, then we have to include this
59  * file before anything else includes inttypes.h or stdint.h for the __STDC
60  * macros to have any effect. Use INT16_MAX as a simple check for success. */
61 #ifndef INT16_MAX
62 #warning #include os/OsIntTypes.h before stdint.h/inttypes.h
63 #define _STDINT_H help_find_first_include_of_stdint.h
64 #define _STDINT_H_ help_find_first_include_of_stdint.h
65 #endif
66 
67 #endif // _OsIntTypes_h_