diff --git a/src/ITMA.hpp b/src/ITMA.hpp index 0184ebb..b64efdb 100644 --- a/src/ITMA.hpp +++ b/src/ITMA.hpp @@ -14,16 +14,21 @@ #include #include -//Windows dll EXPORT definition -//TODO: add Cross-platform dynamic library macros +//_ITMA_EXPORT definition #ifdef ITMA_EXPORT -#define EXPORT __declspec(dllexport) +# if defined(_WIN32) +# define _ITMA_EXPORT __declspec(dllexport) +# elif defined(__GNUC__) +# define _ITMA_EXPORT __attribute__((visibility("default"))) +# else +# define _ITMA_EXPORT +# endif +#elif defined(_WIN32) +# define _ITMA_EXPORT __declspec(dllimport) #else -#define EXPORT __declspec(dllimport) +# define _ITMA_EXPORT #endif //MTMA_EXPORT -/* TODO: Make EXPORT macro compatible with Unix compilers for dynamic link library creation. */ - #include "custom_vector.h" #include "custom_queue.h" @@ -31,7 +36,7 @@ namespace ITMA { class pipe; - class EXPORT MContext + class _ITMA_EXPORT MContext { std::thread context; CustomVector> pipes; @@ -46,7 +51,7 @@ namespace ITMA }; //ZMQPP socket style setup - class EXPORT Channel + class _ITMA_EXPORT Channel { std::shared_ptr pip; MContext & _ctx; @@ -144,7 +149,7 @@ namespace ITMA } }; - class EXPORT pipe + class _ITMA_EXPORT pipe { CustomQueue in; //incoming messages CustomQueue out; //outgoing messages @@ -244,4 +249,4 @@ namespace ITMA }//namespace MTMA -#endif //ITMA_HPP \ No newline at end of file +#endif //ITMA_HPP