summaryrefslogtreecommitdiffstats
path: root/include/ingen/Module.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/ingen/Module.hpp')
-rw-r--r--include/ingen/Module.hpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/ingen/Module.hpp b/include/ingen/Module.hpp
index b540fe7d..1a12a036 100644
--- a/include/ingen/Module.hpp
+++ b/include/ingen/Module.hpp
@@ -17,8 +17,8 @@
#ifndef INGEN_MODULE_HPP
#define INGEN_MODULE_HPP
-#include "ingen/Library.hpp"
-#include "ingen/ingen.h"
+#include <ingen/Library.hpp>
+#include <ingen/ingen.h>
#include <memory>
@@ -31,9 +31,11 @@ class World;
* All components of Ingen reside in one of these.
* @ingroup IngenShared
*/
-class INGEN_API Module {
+class INGEN_API Module
+{
public:
- Module() : library(nullptr) {}
+ Module() noexcept : library(nullptr) {}
+
virtual ~Module() = default;
Module(const Module&) = delete;
@@ -44,8 +46,8 @@ public:
/** Library implementing this module.
*
- * This is managed by the World and not this class, since closing the library
- * in this destructor could possibly reference code from the library
+ * This is managed by the World and not this class, since closing the
+ * library in this destructor could possibly reference code from the library
* afterwards and cause a segfault on exit.
*/
std::unique_ptr<Library> library;
@@ -55,8 +57,14 @@ public:
extern "C" {
+#ifdef _WIN32
+# define INGEN_MODULE_EXPORT __declspec(dllexport)
+#else
+# define INGEN_MODULE_EXPORT __attribute__((visibility("default")))
+#endif
+
/** Prototype for the ingen_module_load() entry point in an ingen module. */
-INGEN_API ingen::Module* ingen_module_load();
+INGEN_MODULE_EXPORT ingen::Module* ingen_module_load();
}