| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef __PJ_COMPAT_LIMITS_H__ |
| 20 |
#define __PJ_COMPAT_LIMITS_H__ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 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 |
|
| 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 |
|
| 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 |