*** empty log message ***
[shishi.git] / asn1 / defines.h
blobfc779a7dfa96fd5a162fce3164df8df0aa26223d
1 /*
2 * Copyright (C) 2000,2001,2002 Nikos Mavroyanopoulos
4 * This file is part of LIBASN1.
6 * LIBASN1 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 * LIBASN1 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
21 #ifndef DEFINES_H
22 # define DEFINES_H
24 #include <config.h>
26 #ifndef __GNUC__
27 # if HAVE_ALLOCA_H
28 # include <alloca.h>
29 # else
30 # ifdef _AIX
31 #pragma alloca
32 # else
33 # ifndef alloca /* predefined by HP cc +Olibcalls */
34 char *alloca();
35 # endif
36 # endif
37 # endif
38 #endif
41 #ifdef STDC_HEADERS
42 # include <string.h>
43 # include <stdlib.h>
44 # include <stdio.h>
45 # include <ctype.h>
46 #endif
48 #ifdef HAVE_STRINGS_H
49 # include <strings.h>
50 #endif
52 #ifdef HAVE_SYS_TYPES_H
53 # include <sys/types.h>
54 #endif
57 #if HAVE_INTTYPES_H
58 # include <inttypes.h>
59 #else
60 # if HAVE_STDINT_H
61 # include <stdint.h>
62 # else
63 #if SIZEOF_UNSIGNED_LONG_INT == 4
64 typedef unsigned long int uint32;
65 typedef signed long int sint32;
66 #elif SIZEOF_UNSIGNED_INT == 4
67 typedef unsigned int uint32;
68 typedef signed int sint32;
69 #else
70 # error "Cannot find a 32 bit integer in your system, sorry."
71 #endif
73 #if SIZEOF_UNSIGNED_INT == 2
74 typedef unsigned int uint16;
75 typedef signed int sint16;
76 #elif SIZEOF_UNSIGNED_SHORT_INT == 2
77 typedef unsigned short int uint16;
78 typedef signed short int sint16;
79 #else
80 # error "Cannot find a 16 bit integer in your system, sorry."
81 #endif
83 #if SIZEOF_UNSIGNED_CHAR == 1
84 typedef unsigned char uint8;
85 typedef signed char int8;
86 #else
87 # error "Cannot find an 8 bit char in your system, sorry."
88 #endif
90 #ifndef HAVE_MEMMOVE
91 # ifdef HAVE_BCOPY
92 # define memmove(d, s, n) bcopy ((s), (d), (n))
93 # else
94 # error "Neither memmove nor bcopy exists on your system."
95 # endif
96 #endif
97 # endif
98 #endif
100 #endif /* defines_h */