| 1 |
#ifndef __REGINA64_H_INCLUDED |
| 2 |
#define __REGINA64_H_INCLUDED |
| 3 |
/* |
| 4 |
* Try and get a 64bit datatype... |
| 5 |
*/ |
| 6 |
#ifndef rx_64u |
| 7 |
# if defined(WIN32) |
| 8 |
# define rx_64 signed __int64 |
| 9 |
# define RX_64MAX _I64_MAX |
| 10 |
# define rx_64u unsigned __int64 |
| 11 |
# define RX_64UMAX _UI64_MAX |
| 12 |
# ifdef __MINGW32__ |
| 13 |
# define rx_mk64u(num) (rx_64u) num##ULL |
| 14 |
# else |
| 15 |
# define rx_mk64u(num) (rx_64u) num##ui64 |
| 16 |
# endif |
| 17 |
# elif defined(__WATCOMC__) && !defined(__QNX__) |
| 18 |
/* You need OpenWatcom 1.1 on Win32 or OS/2 */ |
| 19 |
# define rx_64 signed __int64 |
| 20 |
# define rx_64u unsigned __int64 |
| 21 |
# define rx_mk64u(num) (rx_64u) num##ui64 |
| 22 |
# define RX_64MAX LONGLONG_MAX |
| 23 |
# define RX_64UMAX ULONGLONG_MAX |
| 24 |
# elif defined(HAVE_STDINT_H) && defined(HAVE_INTTYPES_H) |
| 25 |
# define rx_64 int64_t |
| 26 |
# define rx_64u uint64_t |
| 27 |
# define rx_mk64u(num) (rx_64u) num##u |
| 28 |
# define RX_64MAX INT64_MAX |
| 29 |
# define RX_64UMAX UINT64_MAX |
| 30 |
# elif defined(__WORDSIZE) && (__WORDSIZE >= 64) |
| 31 |
# define rx_64 signed |
| 32 |
# define rx_64u unsigned |
| 33 |
# define rx_mk64u(num) (rx_64u) num##u |
| 34 |
# ifdef INT64_MAX |
| 35 |
# define RX_64MAX INT64_MAX |
| 36 |
# endif |
| 37 |
# ifdef UINT64_MAX |
| 38 |
# define RX_64UMAX UINT64_MAX |
| 39 |
# endif |
| 40 |
# elif defined(WORD_BIT) && (WORD_BIT >= 64) |
| 41 |
# define rx_64 signed |
| 42 |
# define rx_64u unsigned |
| 43 |
# define rx_mk64u(num) (rx_64u) num##u |
| 44 |
# ifdef INT64_MAX |
| 45 |
# define RX_64MAX INT64_MAX |
| 46 |
# endif |
| 47 |
# ifdef UINT64_MAX |
| 48 |
# define RX_64UMAX UINT64_MAX |
| 49 |
# endif |
| 50 |
# elif defined(LONG_BIT) && (LONG_BIT >= 64) |
| 51 |
# define rx_64 signed long |
| 52 |
# define rx_64u unsigned long |
| 53 |
# define rx_mk64u(num) (rx_64u) num##ul |
| 54 |
# ifdef INT64_MAX |
| 55 |
# define RX_64MAX INT64_MAX |
| 56 |
# endif |
| 57 |
# ifdef UINT64_MAX |
| 58 |
# define RX_64UMAX UINT64_MAX |
| 59 |
# endif |
| 60 |
# elif defined(ULLONG_MAX) && (ULLONG_MAX != ULONG_MAX) |
| 61 |
# define rx_64 signed long long |
| 62 |
# define rx_64u unsigned long long |
| 63 |
# define rx_mk64u(num) (rx_64u) num##ull |
| 64 |
# define RX_64MAX LLONG_MAX |
| 65 |
# define RX_64UMAX ULLONG_MAX |
| 66 |
# elif defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX) |
| 67 |
# define rx_64 signed long long |
| 68 |
# define rx_64u unsigned long long |
| 69 |
# define rx_mk64u(num) (rx_64u) num##ull |
| 70 |
# define RX_64MAX LONG_LONG_MAX |
| 71 |
# define RX_64UMAX ULONG_LONG_MAX |
| 72 |
# else |
| 73 |
# define rx_64 signed long |
| 74 |
# define rx_64u unsigned long |
| 75 |
# define rx_mk64u(num) (rx_64u) num##ul |
| 76 |
# define RX_64MAX LONG_MAX |
| 77 |
# define RX_64UMAX ULONG_MAX |
| 78 |
# endif |
| 79 |
#endif |
| 80 |
/* |
| 81 |
* Large file support |
| 82 |
* Must have #included config.h before #including this file |
| 83 |
*/ |
| 84 |
#if defined(HAVE__STATI64) |
| 85 |
# define rx_stat_buf _stati64 |
| 86 |
# if defined(WIN32) |
| 87 |
# define rx_stat rx_w32_stat |
| 88 |
# else |
| 89 |
# define rx_stat stati64 |
| 90 |
# endif |
| 91 |
# define rx_fstat _fstati64 |
| 92 |
# define rx_fseek _fseeki64 |
| 93 |
# define rx_ftell _ftelli64 |
| 94 |
#else |
| 95 |
# define rx_stat_buf stat |
| 96 |
# if defined(WIN32) |
| 97 |
# define rx_stat rx_w32_stat |
| 98 |
#else |
| 99 |
# define rx_stat stat |
| 100 |
#endif |
| 101 |
# define rx_fstat fstat |
| 102 |
# define rx_fseek fseek |
| 103 |
# define rx_ftell ftell |
| 104 |
#endif |
| 105 |
|
| 106 |
#if defined(HAVE_FSEEKO) |
| 107 |
# undef rx_fseek |
| 108 |
# define rx_fseek fseeko |
| 109 |
#endif |
| 110 |
|
| 111 |
#if defined(HAVE_FTELLO) |
| 112 |
# undef rx_ftell |
| 113 |
# define rx_ftell ftello |
| 114 |
#endif |
| 115 |
|
| 116 |
#endif |