Added SILC Rand API, SILC Global Variables API and silcruntime.h.in
[runtime.git] / lib / silcutil / silcruntime.h.in
1 /*
2
3   silcruntime.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2008 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef SILCRUNTIME_H
21 #define SILCRUNTIME_H
22
23 /* Version check macro.  Use this to check that package is of specific
24    version compile time.  Use the __SILC_XXX_VERSION below in comparison.
25    Example:
26
27    #if __SILC_RUNTIME_VERSION < SILC_VERSION(1,2,0)
28      ...
29    #endif
30 */
31 #ifndef SILC_VERSION
32 #define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8)
33 #endif /* !SILC_VERSION */
34
35 /* SILC Runtime Toolkit version */
36 @__RUNTIME_PACKAGE_VERSION@
37
38 /* Compilation time defines, for third-party software.  Use these to check
39    in configuration/compilation time how the SILC Runtime Toolkit was
40    configured/compiled. */
41 @__SILC_HAVE_PTHREAD@
42 @__SILC_ENABLE_DEBUG@
43
44 /* Types */
45 #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
46 #define SILC_SIZEOF_LONG @SILC_SIZEOF_LONG@
47 #define SILC_SIZEOF_INT @SILC_SIZEOF_INT@
48 #define SILC_SIZEOF_SHORT @SILC_SIZEOF_SHORT@
49 #define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
50 #define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
51
52 /* Detect OS */
53 #define SILC_UNIX
54
55 #ifdef WIN32
56 #ifndef SILC_WIN32
57 #define SILC_WIN32
58 #undef SILC_UNIX
59 #endif
60 #endif
61
62 #if defined(__EPOC32__) || defined(__SYMBIAN32__)
63 #ifndef SILC_SYMBIAN
64 #define SILC_SYMBIAN
65 #undef SILC_UNIX
66 #undef SILC_WIN32
67 #endif
68 #endif
69
70 #if defined(__MACH__) && defined(__APPLE__)
71 #ifndef SILC_MACOSX
72 #define SILC_MACOSX
73 #undef SILC_WIN32
74 #undef SILC_SYMBIAN
75 #endif
76 #endif
77
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81
82 /* Platform specific includes */
83 #if defined(SILC_WIN32)
84 #include <silcwin32.h>
85 #endif
86
87 #if defined(SILC_SYMBIAN)
88 #include <silcsymbian.h>
89 #endif
90
91 #if defined(HAVE_SILCDEFS_H)
92
93 /* Automatically generated configuration header.  These are included only
94    when the SILC Runtime Toolkit itself is compiled. */
95 #ifndef SILC_SYMBIAN
96 #include "silcdefs.h"
97 #else
98 #include "../../symbian/silcdefs.h"
99 #endif /* SILC_SYMBIAN */
100 #include "silcdistdefs.h"
101 #include "silccompile.h"
102
103 #else
104
105 /* Autodetect CPU so that inline assembly in headers are enabled */
106
107 #if defined(__i386__)
108 #undef SILC_I386
109 #undef SILC_I486
110 #define SILC_I386
111 #define SILC_I486
112 #endif /* __i386__ */
113
114 #if defined(__i486__)
115 #undef SILC_I386
116 #undef SILC_I486
117 #define SILC_I386
118 #define SILC_I486
119 #endif /* __i486__ */
120
121 #if defined(__i586__)
122 #undef SILC_I386
123 #undef SILC_I486
124 #undef SILC_I586
125 #define SILC_I386
126 #define SILC_I486
127 #define SILC_I586
128 #endif /* __i586__ */
129
130 #if defined(__i686__)
131 #undef SILC_I386
132 #undef SILC_I486
133 #undef SILC_I586
134 #undef SILC_I686
135 #define SILC_I386
136 #define SILC_I486
137 #define SILC_I586
138 #define SILC_I686
139 #endif /* __i686__ */
140
141 #if defined(__x86_64__)
142 #undef SILC_X86_64
143 #define SILC_X86_64
144 #endif /* __x86_64__ */
145
146 #if defined(__ia64__)
147 #undef SILC_IA64
148 #define SILC_IA64
149 #endif /* __ia64__ */
150
151 #if defined(__ppc__) || defined(__ppc64__)
152 #undef SILC_POWERPC
153 #define SILC_POWERPC
154 #endif /* __ppc__ || __ppc64__ */
155
156 #ifndef SILC_ALIGNMENT
157 #define SILC_ALIGNMENT SILC_SIZEOF_VOID_P
158 #endif /* SILC_ALIGNMENT */
159
160 #endif /* HAVE_SILCDEFS_H */
161
162 /* SILC Runtime Toolkit includes */
163 #include <silcerrno.h>
164 #include <silctypes.h>
165 #include <silcbitops.h>
166 #include <silcmutex.h>
167 #include <silcatomic.h>
168 #include <silcgetopt.h>
169 #include <silcstack.h>
170 #include <silcmemory.h>
171 #include <silclist.h>
172 #include <silcdlist.h>
173 #include <silcsnprintf.h>
174 #include <silctime.h>
175 #include <silctimer.h>
176 #include <silccond.h>
177 #include <silcglobal.h>
178 #include <silcthread.h>
179 #include <silcthreadqueue.h>
180 #include <silcschedule.h>
181 #include <silclog.h>
182 #include <silcfileutil.h>
183 #include <silcdir.h>
184 #include <silcbuffer.h>
185 #include <silcbuffmt.h>
186 #include <silcasync.h>
187 #include <silcregex.h>
188 #include <silcenv.h>
189 #include <silcdll.h>
190 #include <silchashtable.h>
191 #include <silcstream.h>
192 #include <silcnet.h>
193 #include <silcbase64.h>
194 #include <silcstrutil.h>
195 #include <silcutf8.h>
196 #include <silcstringprep.h>
197 #include <silcutil.h>
198 #include <silcconfig.h>
199 #include <silcfsm.h>
200 #include <silcsocketstream.h>
201 #include <silcfdstream.h>
202 #include <silcmime.h>
203 #include <silcrand.h>
204
205 #ifdef __cplusplus
206 }
207 #endif
208
209 #endif /* SILCRUNTIME_H */