Debian Codegraph @

Xpjproject/pjlib/include/pj/compat/limits.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2017 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2017 George Joseph <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __PJ_COMPAT_LIMITS_H__
20 #define __PJ_COMPAT_LIMITS_H__
21
22 /**
23 * @file limits.h
24 * @brief Provides integer limits normally found in limits.h.
25 */
26
27 #include <pj/config.h>
28
29 #if defined(PJ_HAS_LIMITS_H) && PJ_HAS_LIMITS_H != 0
30 # include <limits.h>
31 #else
32
33 # ifdef _MSC_VER
34 # pragma message("limits.h is not found or not supported. LONG_MIN and "\
35 "LONG_MAX will be defined by the library in "\
36 "pj/compats/limits.h and overridable in config_site.h")
37 # else
38 # warning "limits.h is not found or not supported. LONG_MIN and LONG_MAX " \
39 "will be defined by the library in pj/compats/limits.h and "\
40 "overridable in config_site.h"
41 # endif
42
43 /* Minimum and maximum values a `signed long int' can hold. */
44 # ifndef LONG_MAX
45 # if __WORDSIZE == 64
46 # define LONG_MAX 9223372036854775807L
47 # else
48 # define LONG_MAX 2147483647L
49 # endif
50 # endif
51
52 # ifndef LONG_MIN
53 # define LONG_MIN (-LONG_MAX - 1L)
54 # endif
55
56 /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
57 # ifndef ULONG_MAX
58 # if __WORDSIZE == 64
59 # define ULONG_MAX 18446744073709551615UL
60 # else
61 # define ULONG_MAX 4294967295UL
62 # endif
63 # endif
64 #endif
65
66 #endif /* __PJ_COMPAT_LIMITS_H__ */