2 * This file is part of DisOrder.
3 * Copyright (C) 2004, 2005 Richard Kettlewell
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.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
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
25 # include <inttypes.h>
28 #include <sys/types.h>
30 /* had better be before atol/atoll redefinition */
34 typedef long long long_long;
35 typedef unsigned long long u_long_long;
36 # if ! DECLARES_STRTOLL
37 long long strtoll(const char *, char **, int);
40 long long atoll(const char *);
43 typedef long long_long;
44 typedef unsigned long u_long_long;
46 # define strtoll strtol
50 /* apple define these to j[dxu], which gcc -std=c99 -pedantic then rejects */
61 typedef long long intmax_t;
62 # define PRIdMAX "lld"
64 typedef long intmax_t;
76 typedef unsigned long long uintmax_t;
77 # define PRIuMAX "llu"
78 # define PRIxMAX "llx"
80 typedef unsigned long uintmax_t;
87 typedef unsigned char uint8_t;
89 # error cannot determine uint8_t
94 # if UINT_MAX == 4294967295
95 typedef unsigned int uint32_t;
96 # elif ULONG_MAX == 4294967295
97 typedef unsigned long uint32_t;
98 # elif USHRT_MAX == 4294967295
99 typedef unsigned short uint32_t;
100 # elif UCHAR_MAX == 4294967295
101 typedef unsigned char uint32_t;
103 # error cannot determine uint32_t