From 4ffcaba5d1c8615dae872f794cfbfcd8c9f5e9eb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 4 Oct 2018 14:10:22 -0700 Subject: [PATCH] Important bug fix for MacOS Unlike Linux, RTTI does not work in MacOS/clang when the classes originate from different compile units. I think that Linux's C++ runtime not only checks for identical vtable, but alternatively for same name. On MacOS, dynamic_cast will fail instead. This fix solves this issue by placing the important steam format option specializations into a single specific shared object (the DB plugin). --- src/plugins/streamers/cif/db_plugin/dbCIFFormat.h | 5 +++-- src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h | 5 +++-- src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h | 5 +++-- src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h b/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h index 00164ba83..9cf8a225f 100644 --- a/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h +++ b/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class CIFReaderOptions +class DB_PLUGIN_PUBLIC CIFReaderOptions : public FormatSpecificReaderOptions { public: @@ -118,7 +119,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class CIFWriterOptions +class DB_PLUGIN_PUBLIC CIFWriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h b/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h index 3939795e4..35a6173d0 100644 --- a/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h +++ b/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h @@ -25,6 +25,7 @@ #include "dbLoadLayoutOptions.h" #include "dbSaveLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class DXFReaderOptions +class DB_PLUGIN_PUBLIC DXFReaderOptions : public FormatSpecificReaderOptions { public: @@ -192,7 +193,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class DXFWriterOptions +class DB_PLUGIN_PUBLIC DXFWriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h index 9d16b0856..9daf7056c 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class GDS2ReaderOptions +class DB_PLUGIN_PUBLIC GDS2ReaderOptions : public FormatSpecificReaderOptions { public: @@ -97,7 +98,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class GDS2WriterOptions +class DB_PLUGIN_PUBLIC GDS2WriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h index 4dfa13376..be9235159 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class OASISReaderOptions +class DB_PLUGIN_PUBLIC OASISReaderOptions : public FormatSpecificReaderOptions { public: @@ -92,7 +93,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class OASISWriterOptions +class DB_PLUGIN_PUBLIC OASISWriterOptions : public FormatSpecificWriterOptions { public: