Skip to content

Commit 85633a0

Browse files
committed
Only set OSMIUM_EXPORT when OSMIUM_DEFINE_EXPORT is set
So you need to compile with -DOSMIUM_DEFINE_EXPORT if you want "export attributes" on the exception classes.
1 parent e2de86a commit 85633a0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

include/osmium/util/compatibility.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ DEALINGS IN THE SOFTWARE.
5151
# define OSMIUM_DEPRECATED
5252
#endif
5353

54-
#if defined(_MSC_VER)
55-
# define OSMIUM_EXPORT __declspec(dllexport)
54+
// Set OSMIUM_DEFINE_EXPORT before including any osmium headers to add
55+
// the special attributes to all exception classes.
56+
#ifdef OSMIUM_DEFINE_EXPORT
57+
# ifdef _MSC_VER
58+
# define OSMIUM_EXPORT __declspec(dllexport)
59+
# else
60+
# define OSMIUM_EXPORT __attribute__ ((visibility("default")))
61+
# endif
5662
#else
57-
# define OSMIUM_EXPORT __attribute__ ((visibility("default")))
63+
# define OSMIUM_EXPORT
5864
#endif
5965

6066
#endif // OSMIUM_UTIL_COMPATIBILITY_HPP

0 commit comments

Comments
 (0)