1 |
/* ---------------------------------------------------------------------------- |
---|
2 |
libconfig - A library for processing structured configuration files |
---|
3 |
Copyright (C) 2005-2008 Mark A Lindner |
---|
4 |
|
---|
5 |
This file is part of libconfig. |
---|
6 |
|
---|
7 |
This library is free software; you can redistribute it and/or |
---|
8 |
modify it under the terms of the GNU Lesser General Public License |
---|
9 |
as published by the Free Software Foundation; either version 2.1 of |
---|
10 |
the License, or (at your option) any later version. |
---|
11 |
|
---|
12 |
This library is distributed in the hope that it will be useful, but |
---|
13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 |
Lesser General Public License for more details. |
---|
16 |
|
---|
17 |
You should have received a copy of the GNU Library General Public |
---|
18 |
License along with this library; if not, see |
---|
19 |
<http://www.gnu.org/licenses/>. |
---|
20 |
---------------------------------------------------------------------------- |
---|
21 |
*/ |
---|
22 |
|
---|
23 |
#ifndef __wincompat_h |
---|
24 |
#define __wincompat_h |
---|
25 |
|
---|
26 |
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) |
---|
27 |
|
---|
28 |
#include <windows.h> |
---|
29 |
|
---|
30 |
#define atoll _atoi64 |
---|
31 |
#define strtoull _strtoui64 |
---|
32 |
#define snprintf _snprintf |
---|
33 |
|
---|
34 |
#endif |
---|
35 |
|
---|
36 |
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \ |
---|
37 |
&& ! defined(__MINGW32__) |
---|
38 |
|
---|
39 |
#define INT64_FMT "%I64d" |
---|
40 |
#define UINT64_FMT "%I64u" |
---|
41 |
|
---|
42 |
#define INT64_HEX_FMT "%I64X" |
---|
43 |
|
---|
44 |
#define INT64_CONST(I) (I ## i64) |
---|
45 |
#define UINT64_CONST(I) (I ## Ui64) |
---|
46 |
|
---|
47 |
#ifndef INT32_MAX |
---|
48 |
#define INT32_MAX (2147483647) |
---|
49 |
#endif |
---|
50 |
|
---|
51 |
#ifndef INT32_MIN |
---|
52 |
#define INT32_MIN (-2147483647-1) |
---|
53 |
#endif |
---|
54 |
|
---|
55 |
#else // defined(WIN32) && ! defined(__MINGW32__) |
---|
56 |
|
---|
57 |
#define INT64_FMT "%lld" |
---|
58 |
#define UINT64_FMT "%llu" |
---|
59 |
|
---|
60 |
#define INT64_HEX_FMT "%llX" |
---|
61 |
|
---|
62 |
#define INT64_CONST(I) (I ## LL) |
---|
63 |
#define UINT64_CONST(I) (I ## ULL) |
---|
64 |
|
---|
65 |
#endif // defined(WIN32) && ! defined(__MINGW32__) |
---|
66 |
|
---|
67 |
#endif // __wincompat_h |
---|