Ipopt Documentation  
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
24 #ifndef __IPOPTCONFIG_H__
25 #define __IPOPTCONFIG_H__
26 
27 #ifdef HAVE_CONFIG_H
28 
29 #ifdef IPOPT_BUILD
30 #include "config.h"
31 #else
32 #include "config_ipopt.h"
33 #endif
34 
35 #else /* HAVE_CONFIG_H */
36 
37 #ifdef IPOPT_BUILD
38 #include "config_default.h"
39 #else
40 #include "config_ipopt_default.h"
41 #endif
42 
43 #endif /* HAVE_CONFIG_H */
44 
45 
46 /* overwrite XYZ_EXPORT from config.h when building XYZ
47  * we want it to be __declspec(dllexport) when building a DLL on Windows
48  * we want it to be __attribute__((__visibility__("default"))) when building with GCC,
49  * so user can compile with -fvisibility=hidden
50  */
51 #ifdef IPOPT_BUILD
52 #ifdef DLL_EXPORT
53 #undef IPOPTLIB_EXPORT
54 #define IPOPTLIB_EXPORT __declspec(dllexport)
55 #elif defined(__GNUC__) && __GNUC__ >= 4
56 #undef IPOPTLIB_EXPORT
57 #define IPOPTLIB_EXPORT __attribute__((__visibility__("default")))
58 #endif
59 #endif
60 
61 #ifdef IPOPTAMPL_BUILD
62 #ifdef DLL_EXPORT
63 #undef IPOPTAMPLINTERFACELIB_EXPORT
64 #define IPOPTAMPLINTERFACELIB_EXPORT __declspec(dllexport)
65 #elif defined(__GNUC__) && __GNUC__ >= 4
66 #undef IPOPTAMPLINTERFACELIB_EXPORT
67 #define IPOPTAMPLINTERFACELIB_EXPORT __attribute__((__visibility__("default")))
68 #endif
69 #endif
70 
71 #ifdef SIPOPT_BUILD
72 #ifdef DLL_EXPORT
73 #undef SIPOPTLIB_EXPORT
74 #define SIPOPTLIB_EXPORT __declspec(dllexport)
75 #elif defined(__GNUC__) && __GNUC__ >= 4
76 #undef SIPOPTLIB_EXPORT
77 #define SIPOPTLIB_EXPORT __attribute__((__visibility__("default")))
78 #endif
79 #endif
80 
81 #endif /*__IPOPTCONFIG_H__*/