Define OPENSSL_EXPORT and OPENSSL_IMPORT and give OPENSSL_EXTERN the
[openssl.git] / e_os2.h
1 /* e_os2.h */
2
3 #ifndef HEADER_E_OS2_H
4 #define HEADER_E_OS2_H
5
6 #include <openssl/opensslconf.h> /* OPENSSL_UNISTD */
7
8 #ifdef  __cplusplus
9 extern "C" {
10 #endif
11
12 #ifdef MSDOS
13 # define OPENSSL_UNISTD_IO <io.h>
14 # define OPENSSL_DECLARE_EXIT extern void exit(int);
15 #else
16 # define OPENSSL_UNISTD_IO OPENSSL_UNISTD
17 # define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
18 #endif
19
20 /* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare
21    certain global symbols that, with some compilers under VMS, have to be
22    defined and declared explicitely with globaldef and globalref.
23    Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare
24    DLL exports and imports for compilers under Win32.  These are a little
25    more complicated to use.  Basically, for any library that exports some
26    global variables, the following code must be present in the header file
27    that declares them, before OPENSSL_EXTERN is used:
28
29    #ifdef SOME_BUILD_FLAG_MACRO
30    # undef OPENSSL_EXTERN
31    # define OPENSSL_EXTERN OPENSSL_EXPORT
32    #endif
33
34    The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL
35    have some generally sensible values, and for OPENSSL_EXTERN to have the
36    value OPENSSL_IMPORT.
37 */
38
39 #if defined(VMS) && !defined(__DECC)
40 # define OPENSSL_EXPORT globalref
41 # define OPENSSL_IMPORT globalref
42 # define OPENSSL_GLOBAL globaldef
43 #elif defined(WINDOWS)
44 # define OPENSSL_EXPORT extern _declspec(dllexport)
45 # define OPENSSL_IMPORT extern _declspec(dllimport)
46 # define OPENSSL_GLOBAL
47 #else
48 # define OPENSSL_EXPORT extern
49 # define OPENSSL_IMPORT extern
50 # define OPENSSL_GLOBAL
51 #endif
52 #define OPENSSL_EXTERN OPENSSL_IMPORT
53
54 #ifdef  __cplusplus
55 }
56 #endif
57 #endif