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