File tree 10 files changed +28
-9
lines changed 10 files changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ DEALINGS IN THE SOFTWARE.
42
42
#include < ogr_api.h>
43
43
#include < ogrsf_frmts.h>
44
44
45
+ #include < osmium/util/compatibility.hpp>
46
+
45
47
#include < cstdint>
46
48
#include < algorithm>
47
49
#include < memory>
@@ -63,7 +65,7 @@ namespace gdalcpp {
63
65
/* *
64
66
* Exception thrown for all errors in this class.
65
67
*/
66
- class gdal_error : public std ::runtime_error {
68
+ class OSMIUM_EXPORT gdal_error : public std::runtime_error {
67
69
68
70
std::string m_driver;
69
71
std::string m_dataset;
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ DEALINGS IN THE SOFTWARE.
44
44
#include < osmium/osm/node_ref_list.hpp>
45
45
#include < osmium/osm/types.hpp>
46
46
#include < osmium/osm/way.hpp>
47
+ #include < osmium/util/compatibility.hpp>
47
48
48
49
#include < cstddef>
49
50
#include < stdexcept>
@@ -56,7 +57,7 @@ namespace osmium {
56
57
* Exception thrown when an invalid geometry is encountered. An example
57
58
* would be a linestring with less than two points.
58
59
*/
59
- class geometry_error : public std ::runtime_error {
60
+ class OSMIUM_EXPORT geometry_error : public std::runtime_error {
60
61
61
62
std::string m_message;
62
63
osmium::object_id_type m_id;
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ DEALINGS IN THE SOFTWARE.
33
33
34
34
*/
35
35
36
+ #include < osmium/util/compatibility.hpp>
37
+
36
38
#include < stdexcept>
37
39
#include < string>
38
40
@@ -42,7 +44,7 @@ namespace osmium {
42
44
* Exception thrown when a projection object can not be initialized or the
43
45
* projection of some coordinates can not be calculated.
44
46
*/
45
- struct projection_error : public std ::runtime_error {
47
+ struct OSMIUM_EXPORT projection_error : public std::runtime_error {
46
48
47
49
explicit projection_error (const std::string& what) :
48
50
std::runtime_error(what) {
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ DEALINGS IN THE SOFTWARE.
39
39
#include < osmium/osm/relation.hpp>
40
40
#include < osmium/osm/types.hpp>
41
41
#include < osmium/osm/way.hpp>
42
+ #include < osmium/util/compatibility.hpp>
42
43
43
44
#include < limits>
44
45
#include < stdexcept>
@@ -50,7 +51,7 @@ namespace osmium {
50
51
* Exception thrown when a method in the CheckOrder class detects
51
52
* that the input is out of order.
52
53
*/
53
- struct out_of_order_error : public std ::runtime_error {
54
+ struct OSMIUM_EXPORT out_of_order_error : public std::runtime_error {
54
55
55
56
osmium::object_id_type object_id;
56
57
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ DEALINGS IN THE SOFTWARE.
33
33
34
34
*/
35
35
36
+ #include < osmium/util/compatibility.hpp>
37
+
36
38
#include < cstddef>
37
39
#include < cstdint>
38
40
#include < limits>
@@ -45,7 +47,7 @@ namespace osmium {
45
47
* Exception signaling that an element could not be
46
48
* found in an index.
47
49
*/
48
- struct not_found : public std ::runtime_error {
50
+ struct OSMIUM_EXPORT not_found : public std::runtime_error {
49
51
50
52
explicit not_found (const std::string& what) :
51
53
std::runtime_error(what) {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ DEALINGS IN THE SOFTWARE.
33
33
34
34
*/
35
35
36
+ #include < osmium/util/compatibility.hpp>
36
37
#include < osmium/util/string.hpp>
37
38
38
39
#include < algorithm>
@@ -47,7 +48,7 @@ DEALINGS IN THE SOFTWARE.
47
48
48
49
namespace osmium {
49
50
50
- struct map_factory_error : public std ::runtime_error {
51
+ struct OSMIUM_EXPORT map_factory_error : public std::runtime_error {
51
52
52
53
explicit map_factory_error (const char * message) :
53
54
std::runtime_error(message) {
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ DEALINGS IN THE SOFTWARE.
33
33
34
34
*/
35
35
36
+ #include < osmium/util/compatibility.hpp>
37
+
36
38
#include < stdexcept>
37
39
#include < string>
38
40
@@ -41,7 +43,7 @@ namespace osmium {
41
43
/* *
42
44
* Exception thrown when some kind of input/output operation failed.
43
45
*/
44
- struct io_error : public std ::runtime_error {
46
+ struct OSMIUM_EXPORT io_error : public std::runtime_error {
45
47
46
48
explicit io_error (const std::string& what) :
47
49
std::runtime_error(what) {
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ namespace osmium {
55
55
* to write data into a buffer and it doesn't fit. Buffers with internal
56
56
* memory management will not throw this exception, but increase their size.
57
57
*/
58
- struct buffer_is_full : public std ::runtime_error {
58
+ struct OSMIUM_EXPORT buffer_is_full : public std::runtime_error {
59
59
60
60
buffer_is_full () :
61
61
std::runtime_error{" Osmium buffer is full" } {
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ DEALINGS IN THE SOFTWARE.
33
33
34
34
*/
35
35
36
+ #include < osmium/util/compatibility.hpp>
37
+
36
38
#include < cassert>
37
39
#include < cstdint> // IWYU pragma: keep
38
40
#include < iosfwd>
@@ -192,7 +194,7 @@ namespace osmium {
192
194
* probably means the buffer contains different kinds of objects than were
193
195
* expected or that there is some kind of data corruption.
194
196
*/
195
- struct unknown_type : public std ::runtime_error {
197
+ struct OSMIUM_EXPORT unknown_type : public std::runtime_error {
196
198
197
199
unknown_type () :
198
200
std::runtime_error (" unknown item type" ) {
Original file line number Diff line number Diff line change @@ -51,4 +51,10 @@ DEALINGS IN THE SOFTWARE.
51
51
# define OSMIUM_DEPRECATED
52
52
#endif
53
53
54
+ #if defined(_MSC_VER)
55
+ # define OSMIUM_EXPORT __declspec (dllexport)
56
+ #else
57
+ # define OSMIUM_EXPORT __attribute__ ((visibility(" default" )))
58
+ #endif
59
+
54
60
#endif // OSMIUM_UTIL_COMPATIBILITY_HPP
You can’t perform that action at this time.
0 commit comments