diff --git a/src/ifcparse/ArgumentType.h b/src/ifcparse/ArgumentType.h index 91c89f05c4..48d9063c9f 100644 --- a/src/ifcparse/ArgumentType.h +++ b/src/ifcparse/ArgumentType.h @@ -19,6 +19,8 @@ #include "../ifcparse/IfcSchema.h" +#include "ifc_parse_api.h" + #ifndef ARGUMENTTYPE_H #define ARGUMENTTYPE_H @@ -51,8 +53,8 @@ namespace IfcUtil { Argument_UNKNOWN }; - ArgumentType from_parameter_type(const IfcParse::parameter_type*); - ArgumentType make_aggregate(ArgumentType elem_type); + IFC_PARSE_API ArgumentType from_parameter_type(const IfcParse::parameter_type*); + IFC_PARSE_API ArgumentType make_aggregate(ArgumentType elem_type); } #endif diff --git a/src/ifcwrap/IfcPython.i b/src/ifcwrap/IfcPython.i index 1c16c4f487..d14f968b61 100644 --- a/src/ifcwrap/IfcPython.i +++ b/src/ifcwrap/IfcPython.i @@ -72,6 +72,8 @@ } } +%include "../serializers/serializers_api.h" + // Include headers for the typemaps to function. This set of includes, // can probably be reduced, but for now it's identical to the includes // of the module definition below. diff --git a/src/serializers/ColladaSerializer.h b/src/serializers/ColladaSerializer.h index 5d7651df5a..6adc32a80c 100644 --- a/src/serializers/ColladaSerializer.h +++ b/src/serializers/ColladaSerializer.h @@ -43,13 +43,14 @@ #include "../ifcgeom_schema_agnostic/IfcGeomIterator.h" +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" #include #include -class ColladaSerializer : public WriteOnlyGeometrySerializer +class SERIALIZERS_API ColladaSerializer : public WriteOnlyGeometrySerializer { // TODO The vast amount of implement details of ColladaSerializer could be hidden to the cpp file. private: diff --git a/src/serializers/GltfSerializer.h b/src/serializers/GltfSerializer.h index c9aae885d2..ca8c68303a 100644 --- a/src/serializers/GltfSerializer.h +++ b/src/serializers/GltfSerializer.h @@ -22,6 +22,7 @@ #ifdef WITH_GLTF +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" #include @@ -29,7 +30,7 @@ using json = nlohmann::json; #include -class GltfSerializer : public WriteOnlyGeometrySerializer { +class SERIALIZERS_API GltfSerializer : public WriteOnlyGeometrySerializer { private: std::string filename_, tmp_filename1_, tmp_filename2_; std::ofstream fstream_, tmp_fstream1_, tmp_fstream2_; diff --git a/src/serializers/HdfSerializer.h b/src/serializers/HdfSerializer.h index 568ab5be54..35d82b1aae 100644 --- a/src/serializers/HdfSerializer.h +++ b/src/serializers/HdfSerializer.h @@ -28,11 +28,12 @@ #include "H5Cpp.h" +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" #define USE_BINARY -class HdfSerializer : public GeometrySerializer { +class SERIALIZERS_API HdfSerializer : public GeometrySerializer { private: const std::string hdf_filename; unsigned int vcount_total; diff --git a/src/serializers/OpenCascadeBasedSerializer.h b/src/serializers/OpenCascadeBasedSerializer.h index e289e6ebfd..57d27d6855 100644 --- a/src/serializers/OpenCascadeBasedSerializer.h +++ b/src/serializers/OpenCascadeBasedSerializer.h @@ -20,11 +20,12 @@ #ifndef OPENCASCADEBASEDSERIALIZER_H #define OPENCASCADEBASEDSERIALIZER_H +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/IfcGeomIterator.h" #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" -class OpenCascadeBasedSerializer : public WriteOnlyGeometrySerializer { +class SERIALIZERS_API OpenCascadeBasedSerializer : public WriteOnlyGeometrySerializer { OpenCascadeBasedSerializer(const OpenCascadeBasedSerializer&); //N/A OpenCascadeBasedSerializer& operator =(const OpenCascadeBasedSerializer&); //N/A protected: diff --git a/src/serializers/SvgSerializer.h b/src/serializers/SvgSerializer.h index 344e9fa568..b5cdc64d67 100644 --- a/src/serializers/SvgSerializer.h +++ b/src/serializers/SvgSerializer.h @@ -23,6 +23,7 @@ #define SVGSERIALIZER_H #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" +#include "../serializers/serializers_api.h" #include "../serializers/util.h" #include "../ifcparse/utils.h" @@ -135,7 +136,7 @@ typedef boost::variant< Handle(HLRBRep_PolyAlgo) > hlr_t; -class SvgSerializer : public WriteOnlyGeometrySerializer { +class SERIALIZERS_API SvgSerializer : public WriteOnlyGeometrySerializer { public: typedef std::pair > path_object; typedef std::vector< boost::shared_ptr > float_item_list; diff --git a/src/serializers/WavefrontObjSerializer.h b/src/serializers/WavefrontObjSerializer.h index f640fd0db4..fd493ca025 100644 --- a/src/serializers/WavefrontObjSerializer.h +++ b/src/serializers/WavefrontObjSerializer.h @@ -24,10 +24,11 @@ #include #include +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/GeometrySerializer.h" // http://people.sc.fsu.edu/~jburkardt/txt/obj_format.txt -class WaveFrontOBJSerializer : public WriteOnlyGeometrySerializer { +class SERIALIZERS_API WaveFrontOBJSerializer : public WriteOnlyGeometrySerializer { private: stream_or_filename obj_stream; stream_or_filename mtl_stream; diff --git a/src/serializers/XmlSerializer.h b/src/serializers/XmlSerializer.h index 0c18a24ddc..ac2c16f4fe 100644 --- a/src/serializers/XmlSerializer.h +++ b/src/serializers/XmlSerializer.h @@ -1,5 +1,6 @@ #define SCHEMA_METHOD +#include "../serializers/serializers_api.h" #include "../ifcgeom_schema_agnostic/Serializer.h" #include "../ifcparse/IfcFile.h" @@ -7,7 +8,7 @@ #include -class XmlSerializer : public Serializer { +class SERIALIZERS_API XmlSerializer : public Serializer { private: XmlSerializer* implementation_; @@ -26,7 +27,7 @@ public: void setFile(IfcParse::IfcFile*) { throw IfcParse::IfcException("Should be supplied on construction"); } }; -struct XmlSerializerFactory { +struct SERIALIZERS_API XmlSerializerFactory { typedef boost::function2 fn; class Factory : public std::map { diff --git a/src/serializers/serializers_api.h b/src/serializers/serializers_api.h new file mode 100644 index 0000000000..a46a27122b --- /dev/null +++ b/src/serializers/serializers_api.h @@ -0,0 +1,37 @@ +/******************************************************************************** +* * +* This file is part of IfcOpenShell. * +* * +* IfcOpenShell is free software: you can redistribute it and/or modify * +* it under the terms of the Lesser GNU General Public License as published by * +* the Free Software Foundation, either version 3.0 of the License, or * +* (at your option) any later version. * +* * +* IfcOpenShell is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* Lesser GNU General Public License for more details. * +* * +* You should have received a copy of the Lesser GNU General Public License * +* along with this program. If not, see . * +* * +********************************************************************************/ + +#ifndef IFC_SERIALIZERS_API_H +#define IFC_SERIALIZERS_API_H + +#ifdef IFC_SHARED_BUILD + #ifdef _WIN32 + #ifdef Serializers_EXPORTS + #define SERIALIZERS_API __declspec(dllexport) + #else + #define SERIALIZERS_API __declspec(dllimport) + #endif + #else // simply assume *nix + GCC-like compiler + #define SERIALIZERS_API __attribute__((visibility("default"))) + #endif +#else + #define SERIALIZERS_API +#endif + +#endif diff --git a/src/svgfill b/src/svgfill index 2b28e69b13..f9102b1e9f 160000 --- a/src/svgfill +++ b/src/svgfill @@ -1 +1 @@ -Subproject commit 2b28e69b136d939a46face3ac87e9c9c8aed3dfd +Subproject commit f9102b1e9f58e2c3bf9923c1eafa0373eeb872f5