]> Creatis software - cpPlugins.git/blob - lib/third_party/Pluma/Connector.hpp
3c227e7ef7bffd7f3b48268895c1ce677f2caa10
[cpPlugins.git] / lib / third_party / Pluma / Connector.hpp
1 ////////////////////////////////////////////////////////////\r
2 //\r
3 // Pluma - Plug-in Management Framework\r
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)\r
5 //\r
6 // This software is provided 'as-is', without any express or implied warranty.\r
7 // In no event will the authors be held liable for any damages arising from the use of this software.\r
8 //\r
9 // Permission is granted to anyone to use this software for any purpose,\r
10 // including commercial applications, and to alter it and redistribute it freely,\r
11 // subject to the following restrictions:\r
12 //\r
13 // 1. The origin of this software must not be misrepresented;\r
14 //    you must not claim that you wrote the original software.\r
15 //    If you use this software in a product, an acknowledgment\r
16 //    in the product documentation would be appreciated but is not required.\r
17 //\r
18 // 2. Altered source versions must be plainly marked as such,\r
19 //    and must not be misrepresented as being the original software.\r
20 //\r
21 // 3. This notice may not be removed or altered from any source distribution.\r
22 //\r
23 ////////////////////////////////////////////////////////////\r
24 \r
25 #ifndef PLUMA_CONNECTOR_HPP\r
26 #define PLUMA_CONNECTOR_HPP\r
27 \r
28 ////////////////////////////////////////////////////////////\r
29 // Headers\r
30 ////////////////////////////////////////////////////////////\r
31 #include <Pluma/Config.hpp>\r
32 #include <Pluma/Pluma.hpp>\r
33 \r
34 \r
35 /////////////////////////////////////////////////////////////////\r
36 // Define portable import/export macros for Plugin registration\r
37 /////////////////////////////////////////////////////////////////\r
38 #if defined(PLUMA_SYS_WINDOWS)\r
39 \r
40     #ifndef PLUMA_STATIC_PLUGIN\r
41 \r
42          // Windows platforms\r
43         #ifndef PLUGIN_IMPORTS\r
44 \r
45             // From DLL side, we must export\r
46             #ifdef __cplusplus\r
47                #define PLUMA_CONNECTOR extern "C" __declspec(dllexport)\r
48             #else\r
49                #define PLUMA_CONNECTOR __declspec(dllexport)\r
50             #endif\r
51 \r
52         #else\r
53 \r
54             // From client application side, we must import\r
55             #ifdef __cplusplus\r
56                #define PLUMA_CONNECTOR extern "C" __declspec(dllimport)\r
57             #else\r
58                #define PLUMA_CONNECTOR __declspec(dllimport)\r
59             #endif\r
60 \r
61         #endif\r
62 \r
63     #else\r
64 \r
65         // Only define the extern "C" for static build\r
66         #ifdef __cplusplus\r
67            #define PLUMA_CONNECTOR extern "C"\r
68         #else\r
69            #define PLUMA_CONNECTOR\r
70         #endif\r
71 \r
72     #endif\r
73 \r
74 #else\r
75 \r
76     // Only define the extern "C" for other platforms\r
77     #ifdef __cplusplus\r
78        #define PLUMA_CONNECTOR extern "C"\r
79     #else\r
80        #define PLUMA_CONNECTOR\r
81     #endif\r
82 \r
83 #endif\r
84 \r
85 \r
86 #endif // PLUMA_CONNECTOR_HPP\r