2
* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
4
* This file is part of GnuPG.
6
* GnuPG is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* GnuPG is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
1
/* types.h - define some extra types
2
* Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
4
* This file is part of JNLIB.
6
* JNLIB is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License as
8
* published by the Free Software Foundation; either version 3 of
9
* the License, or (at your option) any later version.
11
* JNLIB is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
21
20
#ifndef LIBJNLIB_TYPES_H
24
23
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
25
24
* we provide some fallback values here */
26
25
#if !SIZEOF_UNSIGNED_SHORT
27
#undef SIZEOF_UNSIGNED_SHORT
28
#define SIZEOF_UNSIGNED_SHORT 2
26
# undef SIZEOF_UNSIGNED_SHORT
27
# define SIZEOF_UNSIGNED_SHORT 2
30
29
#if !SIZEOF_UNSIGNED_INT
31
#undef SIZEOF_UNSIGNED_INT
32
#define SIZEOF_UNSIGNED_INT 4
30
# undef SIZEOF_UNSIGNED_INT
31
# define SIZEOF_UNSIGNED_INT 4
34
33
#if !SIZEOF_UNSIGNED_LONG
35
#undef SIZEOF_UNSIGNED_LONG
36
#define SIZEOF_UNSIGNED_LONG 4
34
# undef SIZEOF_UNSIGNED_LONG
35
# define SIZEOF_UNSIGNED_LONG 4
43
42
#ifndef HAVE_BYTE_TYPEDEF
44
#undef byte /* maybe there is a macro with this name */
43
# undef byte /* There might be a macro with this name. */
45
44
/* Windows typedefs byte in the rpc headers. Avoid warning about
46
45
double definition. */
47
46
#if !(defined(_WIN32) && defined(cbNDRContext))
48
47
typedef unsigned char byte;
50
#define HAVE_BYTE_TYPEDEF
49
# define HAVE_BYTE_TYPEDEF
53
52
#ifndef HAVE_USHORT_TYPEDEF
54
#undef ushort /* maybe there is a macro with this name */
55
typedef unsigned short ushort;
56
#define HAVE_USHORT_TYPEDEF
53
# undef ushort /* There might be a macro with this name. */
54
typedef unsigned short ushort;
55
# define HAVE_USHORT_TYPEDEF
59
58
#ifndef HAVE_ULONG_TYPEDEF
60
#undef ulong /* maybe there is a macro with this name */
61
typedef unsigned long ulong;
62
#define HAVE_ULONG_TYPEDEF
59
# undef ulong /* There might be a macro with this name. */
60
typedef unsigned long ulong;
61
# define HAVE_ULONG_TYPEDEF
65
64
#ifndef HAVE_U16_TYPEDEF
66
#undef u16 /* maybe there is a macro with this name */
67
#if SIZEOF_UNSIGNED_INT == 2
68
typedef unsigned int u16;
69
#elif SIZEOF_UNSIGNED_SHORT == 2
70
typedef unsigned short u16;
72
#error no typedef for u16
74
#define HAVE_U16_TYPEDEF
65
# undef u16 /* There might be a macro with this name. */
66
# if SIZEOF_UNSIGNED_INT == 2
67
typedef unsigned int u16;
68
# elif SIZEOF_UNSIGNED_SHORT == 2
69
typedef unsigned short u16;
71
# error no typedef for u16
73
# define HAVE_U16_TYPEDEF
77
76
#ifndef HAVE_U32_TYPEDEF
78
#undef u32 /* maybe there is a macro with this name */
79
#if SIZEOF_UNSIGNED_INT == 4
80
typedef unsigned int u32;
81
#elif SIZEOF_UNSIGNED_LONG == 4
82
typedef unsigned long u32;
84
#error no typedef for u32
86
#define HAVE_U32_TYPEDEF
77
# undef u32 /* There might be a macro with this name. */
78
# if SIZEOF_UNSIGNED_INT == 4
79
typedef unsigned int u32;
80
# elif SIZEOF_UNSIGNED_LONG == 4
81
typedef unsigned long u32;
83
# error no typedef for u32
85
# define HAVE_U32_TYPEDEF
89
88
#ifndef HAVE_U64_TYPEDEF
90
#undef u64 /* maybe there is a macro with this name */
91
#if SIZEOF_UNSIGNED_INT == 8
92
typedef unsigned int u64;
93
#define HAVE_U64_TYPEDEF
94
#elif SIZEOF_UNSIGNED_LONG == 8
95
typedef unsigned long u64;
96
#define HAVE_U64_TYPEDEF
97
#elif __GNUC__ >= 2 || defined(__SUNPRO_C)
98
typedef unsigned long long u64;
99
#define HAVE_U64_TYPEDEF
89
# undef u64 /* There might be a macro with this name. */
90
# if SIZEOF_UNSIGNED_INT == 8
91
typedef unsigned int u64;
92
# define HAVE_U64_TYPEDEF
93
# elif SIZEOF_UNSIGNED_LONG == 8
94
typedef unsigned long u64;
95
# define HAVE_U64_TYPEDEF
96
# elif __GNUC__ >= 2 || defined(__SUNPRO_C)
97
typedef unsigned long long u64;
98
# define HAVE_U64_TYPEDEF
105
102
#endif /*LIBJNLIB_TYPES_H*/