Ipopt Documentation  
IpoptConfig.h
Go to the documentation of this file.
1 /* Copyright (C) 2011
2  * All Rights Reserved.
3  * This code is published under the Eclipse Public License.
4  */
5 
22 #ifndef __IPOPTCONFIG_H__
23 #define __IPOPTCONFIG_H__
24 
25 #ifdef HAVE_CONFIG_H
26 
27 #ifdef IPOPTLIB_BUILD
28 #include "config.h"
29 #else
30 #include "config_ipopt.h"
31 #endif
32 
33 #else /* HAVE_CONFIG_H */
34 
35 #ifdef IPOPTLIB_BUILD
36 #include "config_default.h"
37 #else
38 #include "config_ipopt_default.h"
39 #endif
40 
41 #endif /* HAVE_CONFIG_H */
42 
43 /* overwrite XYZ_EXPORT from config.h when building XYZ
44  * we want it to be __declspec(dllexport) when building a DLL on Windows
45  * we want it to be __attribute__((__visibility__("default"))) when building with GCC,
46  * so user can compile with -fvisibility=hidden
47  */
48 #ifdef IPOPTLIB_BUILD
49 # ifdef DLL_EXPORT
50 # undef IPOPTLIB_EXPORT
51 # define IPOPTLIB_EXPORT __declspec(dllexport)
52 # elif defined(__GNUC__) && __GNUC__ >= 4
53 # undef IPOPTLIB_EXPORT
54 # define IPOPTLIB_EXPORT __attribute__((__visibility__("default")))
55 # endif
56 #endif
57 
58 #ifdef IPOPTAMPLINTERFACELIB_BUILD
59 # ifdef DLL_EXPORT
60 # undef IPOPTAMPLINTERFACELIB_EXPORT
61 # define IPOPTAMPLINTERFACELIB_EXPORT __declspec(dllexport)
62 # elif defined(__GNUC__) && __GNUC__ >= 4
63 # undef IPOPTAMPLINTERFACELIB_EXPORT
64 # define IPOPTAMPLINTERFACELIB_EXPORT __attribute__((__visibility__("default")))
65 # endif
66 #endif
67 
68 #ifdef SIPOPTLIB_BUILD
69 # ifdef DLL_EXPORT
70 # undef SIPOPTLIB_EXPORT
71 # define SIPOPTLIB_EXPORT __declspec(dllexport)
72 # elif defined(__GNUC__) && __GNUC__ >= 4
73 # undef SIPOPTLIB_EXPORT
74 # define SIPOPTLIB_EXPORT __attribute__((__visibility__("default")))
75 # endif
76 #endif
77 
78 #endif /*__IPOPTCONFIG_H__*/