librsync  2.0.1
types.h
1 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
2  *
3  * librsync -- the library for network deltas
4  *
5  * Copyright (C) 2001 by Martin Pool <[email protected]>
6  *
7  * This program 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 program 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 Lesser General Public
18  * License along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 #define HAVE_UINT64 1 /* assume success, but might be undefined below */
23 
24 #if defined(HAVE_STDINT_H)
25 # include <stdint.h>
26 #else
27 # if SIZEOF_UNSIGNED_INT == 4
28 # define uint32_t unsigned int
29 # elif SIZEOF_UNSIGNED_LONG == 4
30 # define uint32_t unsigned long
31 # elif SIZEOF_UNSIGNED_SHORT == 4
32 # define uint32_t unsigned short
33 # else
34 # error "can't find an appropriate 32-bit integer type"
35 # endif
36 # if SIZEOF_UNSIGNED_INT == 8
37 # define uint64_t unsigned int
38 # elif SIZEOF_UNSIGNED_LONG == 8
39 # define uint64_t unsigned long
40 # elif SIZEOF_UNSIGNED_SHORT == 8
41 # define uint64_t unsigned short
42 # elif SIZEOF_LONG_LONG == 8
43 # define uint64_t unsigned long long
44 # else
45 # undef HAVE_UINT64
46 # endif
47 #endif