Add.
[libtasn1.git] / lib / defines.h
blob91c03ad4a80a6b52fc87980bcb79ece7bab8650b
1 /*
2 * Copyright (C) 2000,2001,2002,2005 Nikos Mavroyanopoulos
4 * This file is part of LIBTASN1.
6 * LIBTASN1 is free software; you can redistribute it and/or modify it
7 * 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 * LIBTASN1 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 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with LIBTASN1; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef DEFINES_H
22 # define DEFINES_H
24 #ifdef HAVE_CONFIG_H
25 # include <config.h>
26 #endif
28 #ifdef STDC_HEADERS
29 # include <string.h>
30 # include <stdlib.h>
31 # include <stdio.h>
32 # include <ctype.h>
33 #endif
35 #ifdef HAVE_STRINGS_H
36 # include <strings.h>
37 #endif
39 #ifdef HAVE_SYS_TYPES_H
40 # include <sys/types.h>
41 #endif
43 #if HAVE_INTTYPES_H
44 # include <inttypes.h>
45 #else
46 # if HAVE_STDINT_H
47 # include <stdint.h>
48 # else
49 # if SIZEOF_UNSIGNED_LONG_INT == 4
50 typedef unsigned long int uint32;
51 typedef signed long int sint32;
52 # elif SIZEOF_UNSIGNED_INT == 4
53 typedef unsigned int uint32;
54 typedef signed int sint32;
55 # else
56 # error "Cannot find a 32 bit integer in your system, sorry."
57 # endif
58 # if SIZEOF_UNSIGNED_INT == 2
59 typedef unsigned int uint16;
60 typedef signed int sint16;
61 # elif SIZEOF_UNSIGNED_SHORT_INT == 2
62 typedef unsigned short int uint16;
63 typedef signed short int sint16;
64 # else
65 # error "Cannot find a 16 bit integer in your system, sorry."
66 # endif
67 # if SIZEOF_UNSIGNED_CHAR == 1
68 typedef unsigned char uint8;
69 typedef signed char int8;
70 # else
71 # error "Cannot find an 8 bit char in your system, sorry."
72 # endif
73 # endif
74 #endif
76 #endif /* defines_h */