Git init
[external/xmlsec1.git] / include / xmlsec / exports.h
1 /** 
2  * XML Security Library (http://www.aleksey.com/xmlsec).
3  *
4  * Export macro declarations for Win32 platform.
5  *
6  * This is free software; see Copyright file in the source
7  * distribution for preciese wording.
8  * 
9  * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
10  */
11 #ifndef __XMLSEC_EXPORTS_H__
12 #define __XMLSEC_EXPORTS_H__    
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */ 
17
18 /* Now, the export orgy begins. The following we must do for the 
19    Windows platform with MSVC compiler. */
20
21 #if !defined XMLSEC_EXPORT
22 #  if defined(_WIN32)
23      /* if we compile libxmlsec itself: */
24 #    if defined(IN_XMLSEC)
25 #      if !defined(XMLSEC_STATIC)
26 #        define XMLSEC_EXPORT __declspec(dllexport) 
27 #      else
28 #        define XMLSEC_EXPORT extern
29 #      endif
30      /* if a client program includes this file: */
31 #    else
32 #if 1
33        /* gcc fail by initialisation of global variable with error
34           (as example in .../openssl/ciphers.c):
35             "initializer element is not constant"
36           To avoid this we shouldn't use __declspec(dllimport).
37           This will enable auto-import feature. */
38 #      define XMLSEC_EXPORT
39 #else
40 #      if !defined(XMLSEC_STATIC)
41 #        define XMLSEC_EXPORT __declspec(dllimport) 
42 #      else
43 #        define XMLSEC_EXPORT 
44 #      endif
45 #endif
46 #    endif
47    /* This holds on all other platforms/compilers, which are easier to
48       handle in regard to this. */
49 #  else
50 #    define XMLSEC_EXPORT
51 #  endif
52 #endif
53
54 #if !defined XMLSEC_CRYPTO_EXPORT
55 #  if defined(_WIN32)
56      /* if we compile libxmlsec itself: */
57 #    if defined(IN_XMLSEC_CRYPTO)
58 #      if !defined(XMLSEC_STATIC)
59 #        define XMLSEC_CRYPTO_EXPORT __declspec(dllexport) 
60 #      else
61 #        define XMLSEC_CRYPTO_EXPORT extern
62 #      endif
63      /* if a client program includes this file: */
64 #    else
65 #      if !defined(XMLSEC_STATIC)
66 #        define XMLSEC_CRYPTO_EXPORT __declspec(dllimport) 
67 #      else
68 #        define XMLSEC_CRYPTO_EXPORT 
69 #      endif
70 #    endif
71    /* This holds on all other platforms/compilers, which are easier to
72       handle in regard to this. */
73 #  else
74 #    define XMLSEC_CRYPTO_EXPORT
75 #  endif
76 #endif
77
78 #if !defined XMLSEC_EXPORT_VAR
79 #  if defined(_WIN32)
80      /* if we compile libxmlsec itself: */
81 #    if defined(IN_XMLSEC)
82 #      if !defined(XMLSEC_STATIC)
83 #        define XMLSEC_EXPORT_VAR __declspec(dllexport) extern
84 #      else
85 #        define XMLSEC_EXPORT_VAR extern
86 #      endif
87      /* if we compile libxmlsec-crypto itself: */
88 #    elif defined(IN_XMLSEC_CRYPTO)
89 #        define XMLSEC_EXPORT_VAR extern
90      /* if a client program includes this file: */
91 #    else
92 #      if !defined(XMLSEC_STATIC)
93 #        define XMLSEC_EXPORT_VAR __declspec(dllimport) extern
94 #      else
95 #        define XMLSEC_EXPORT_VAR extern
96 #      endif
97 #    endif
98    /* This holds on all other platforms/compilers, which are easier to
99       handle in regard to this. */
100 #  else
101 #    define XMLSEC_EXPORT_VAR extern
102 #  endif
103 #endif
104
105 #ifdef __cplusplus
106 }
107 #endif /* __cplusplus */
108
109 #endif /* __XMLSEC_EXPORTS_H__ */
110
111