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 
44 /* overwrite XYZ_EXPORT from config.h when building XYZ
45  * we want it to be __declspec(dllexport) when building a DLL on Windows
46  * we want it to be __attribute__((__visibility__("default"))) when building with GCC,
47  * so user can compile with -fvisibility=hidden
48  */
49 #ifdef IPOPTLIB_BUILD
50 # ifdef DLL_EXPORT
51 # undef IPOPTLIB_EXPORT
52 # define IPOPTLIB_EXPORT __declspec(dllexport)
53 # elif defined(__GNUC__) && __GNUC__ >= 4
54 # undef IPOPTLIB_EXPORT
55 # define IPOPTLIB_EXPORT __attribute__((__visibility__("default")))
56 # endif
57 #endif
58 
59 #ifdef IPOPTAMPLINTERFACELIB_BUILD
60 # ifdef DLL_EXPORT
61 # undef IPOPTAMPLINTERFACELIB_EXPORT
62 # define IPOPTAMPLINTERFACELIB_EXPORT __declspec(dllexport)
63 # elif defined(__GNUC__) && __GNUC__ >= 4
64 # undef IPOPTAMPLINTERFACELIB_EXPORT
65 # define IPOPTAMPLINTERFACELIB_EXPORT __attribute__((__visibility__("default")))
66 # endif
67 #endif
68 
69 #ifdef SIPOPTLIB_BUILD
70 # ifdef DLL_EXPORT
71 # undef SIPOPTLIB_EXPORT
72 # define SIPOPTLIB_EXPORT __declspec(dllexport)
73 # elif defined(__GNUC__) && __GNUC__ >= 4
74 # undef SIPOPTLIB_EXPORT
75 # define SIPOPTLIB_EXPORT __attribute__((__visibility__("default")))
76 # endif
77 #endif
78 
79 #endif /*__IPOPTCONFIG_H__*/