~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-updates

« back to all changes in this revision

Viewing changes to jnlib/types.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* types.h
2
 
 *      Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
3
 
 *
4
 
 * This file is part of GnuPG.
5
 
 *
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.
10
 
 *
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.
15
 
 *
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.
 
3
 *
 
4
 * This file is part of JNLIB.
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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/>.
19
18
 */
20
19
 
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
29
28
#endif
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
33
32
#endif
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
37
36
#endif
38
37
 
39
38
 
41
40
 
42
41
 
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;
49
48
#endif
50
 
  #define HAVE_BYTE_TYPEDEF
 
49
#  define HAVE_BYTE_TYPEDEF
51
50
#endif
52
51
 
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
57
56
#endif
58
57
 
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
63
62
#endif
64
63
 
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;
71
 
  #else
72
 
    #error no typedef for u16
73
 
  #endif
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;
 
70
#  else
 
71
#    error no typedef for u16
 
72
#  endif
 
73
#  define HAVE_U16_TYPEDEF
75
74
#endif
76
75
 
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;
83
 
  #else
84
 
    #error no typedef for u32
85
 
  #endif
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;
 
82
#  else
 
83
#    error no typedef for u32
 
84
#  endif
 
85
#  define HAVE_U32_TYPEDEF
87
86
#endif
88
87
 
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
100
 
  #endif
 
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
 
99
#  endif
101
100
#endif
102
101
 
103
 
 
104
 
 
105
102
#endif /*LIBJNLIB_TYPES_H*/