Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
IntTypes.h
Go to the documentation of this file.
1/**************************************************************************************[IntTypes.h]
2Copyright (c) 2009-2010, Niklas Sorensson
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5associated documentation files (the "Software"), to deal in the Software without restriction,
6including without limitation the rights to use, copy, modify, merge, publish, distribute,
7sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8furnished to do so, subject to the following conditions:
9
10The above copyright notice and this permission notice shall be included in all copies or
11substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
14NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
17OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18**************************************************************************************************/
19
20#pragma once
21
22#ifdef __sun
23 // Not sure if there are newer versions that support C99 headers. The
24 // needed features are implemented in the headers below though:
25
26# include <sys/int_types.h>
27# include <sys/int_fmtio.h>
28# include <sys/int_limits.h>
29
30#elif _MSC_VER
31
32# include <stdint.h>
33
34#else
35
36# include <stdint.h>
37# include <inttypes.h>
38# include <limits.h>
39
40#endif
41
42#include <limits>
43
44 #ifndef INT32_MIN
45 #define INT32_MIN std::numeric_limits<int>::min()
46 #endif
47 #ifndef INT32_MAX
48 #define INT32_MAX std::numeric_limits<int>::max()
49 #endif
50 #ifndef INT64_MIN
51 #define INT64_MIN std::numeric_limits<long>::min()
52 #endif
53 #ifndef INT64_MAX
54 #define INT64_MAX std::numeric_limits<long>::max()
55 #endif
56 #ifndef UINT32_MIN
57 #define UINT32_MIN std::numeric_limits<unsigned int>::min()
58 #endif
59 #ifndef UINT32_MAX
60 #define UINT32_MAX std::numeric_limits<unsigned int>::max()
61 #endif
62 #ifndef UINT64_MIN
63 #define UINT64_MIN std::numeric_limits<unsigned long>::min()
64 #endif
65 #ifndef UINT64_MAX
66 #define UINT64_MAX std::numeric_limits<unsigned long>::max()
67 #endif
68
69
70//=================================================================================================