]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/bacula.h
Update the Microsoft Visual Studio build to match the MinGW32 build.
[bacula/bacula] / bacula / src / bacula.h
1 /*
2  * bacula.h -- main header file to include in all Bacula source
3  *
4  *   Version $Id$
5  */
6 /*
7    Copyright (C) 2000-2006 Kern Sibbald
8
9    This program is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    version 2 as amended with additional clauses defined in the
12    file LICENSE in the main source directory.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
17    the file LICENSE for additional details.
18
19  */
20
21 #ifndef _BACULA_H
22 #define _BACULA_H 1
23
24 #ifdef __cplusplus
25 /* Workaround for SGI IRIX 6.5 */
26 #define _LANGUAGE_C_PLUS_PLUS 1
27 #endif
28
29 #if defined(HAVE_WIN32)
30 #if defined(HAVE_MINGW)
31 #include "mingwconfig.h"
32 #else
33 #include "winconfig.h"
34 #endif
35 #else
36 #include "config.h"
37 #endif
38
39
40 #define _REENTRANT    1
41 #define _THREAD_SAFE  1
42 #define _POSIX_PTHREAD_SEMANTICS 1
43
44
45 /* System includes */
46 #if HAVE_STDINT_H
47 #include <stdint.h>
48 #endif
49 #if HAVE_STDARG_H
50 #include <stdarg.h>
51 #endif
52 #include <stdio.h>
53 #if HAVE_STDLIB_H
54 #include <stdlib.h>
55 #endif
56 #if HAVE_UNISTD_H
57 #  ifdef HAVE_HPUX_OS
58 #  undef _INCLUDE_POSIX1C_SOURCE
59 #  endif
60 #include <unistd.h>
61 #endif
62 #if HAVE_ALLOCA_H
63 #include <alloca.h>
64 #endif
65 #if defined(_MSC_VER)
66 #include <io.h>
67 #include <direct.h>
68 #include <process.h>
69 #endif
70 #include <errno.h>
71 #include <fcntl.h>
72
73 /* O_NOATIME is defined at fcntl.h when supported */
74 #ifndef O_NOATIME
75 #define O_NOATIME 0
76 #endif
77
78 #if defined(_MSC_VER)
79 extern "C" {
80 #include "getopt.h"
81 }
82 #endif
83
84 #ifdef xxxxx
85 #ifdef HAVE_GETOPT_LONG
86 #include <getopt.h>
87 #else
88 #include "lib/getopt.h"
89 #endif
90 #endif
91
92 #include <string.h>
93 #include <strings.h>
94 #include <signal.h>
95 #include <ctype.h>
96 #ifndef _SPLINT_
97 #include <syslog.h>
98 #endif
99 #if HAVE_LIMITS_H
100 #include <limits.h>
101 #endif
102 #include <pwd.h>
103 #include <grp.h>
104 #include <time.h>
105 #include <netdb.h>
106 #include <sys/types.h>
107 #ifdef HAVE_SYS_BITYPES_H
108 #include <sys/bitypes.h>
109 #endif
110 #include <sys/ioctl.h>
111 #ifdef HAVE_SYS_SOCKET_H
112 #include <sys/socket.h>
113 #endif
114 #if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
115 #include <winsock2.h>
116 #endif 
117 #if !defined(HAVE_WIN32) & !defined(HAVE_MINGW)
118 #include <sys/stat.h>
119 #endif 
120 #include <sys/time.h>
121 #if HAVE_SYS_WAIT_H
122 #include <sys/wait.h>
123 #endif
124 #include <netinet/in.h>
125 #include <arpa/inet.h>
126 #include <pthread.h>
127
128 #ifdef HAVE_OPENSSL
129 /* fight OpenSSL namespace pollution */
130 #define STORE OSSL_STORE
131 #include <openssl/ssl.h>
132 #include <openssl/x509v3.h>
133 #include <openssl/rand.h>
134 #include <openssl/err.h>
135 #include <openssl/asn1.h>
136 #include <openssl/asn1t.h>
137 #undef STORE
138 #endif
139
140 /* Local Bacula includes. Be sure to put all the system
141  *  includes before these.
142  */
143 #if defined(HAVE_WIN32)
144 #include <windows.h>
145 #include "win32/compat/compat.h"
146 #endif
147
148 #include "version.h"
149 #include "bc_types.h"
150 #include "baconfig.h"
151 #include "lib/lib.h"
152
153 /*
154  * For wx-console compiles, we undo some Bacula defines.
155  *  This prevents conflicts between wx-Widgets and Bacula.
156  *  In wx-console files that malloc or free() Bacula structures
157  *  config/resources and interface to the Bacula libraries,
158  *  you must use bmalloc() and bfree().
159  */
160 #ifdef HAVE_WXCONSOLE
161 #undef New
162 #undef _
163 #undef free
164 #undef malloc
165 #endif
166
167 #if defined(HAVE_WIN32)
168 #include "win32/winapi.h"
169 #include "winhost.h"
170 #else
171 #include "host.h"
172 #endif
173
174 #ifndef HAVE_ZLIB_H
175 #undef HAVE_LIBZ                      /* no good without headers */
176 #endif
177
178 #endif