Connector.hpp
00001 
00002 //
00003 // Pluma - Plug-in Management Framework
00004 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024 
00025 #ifndef PLUMA_CONNECTOR_HPP
00026 #define PLUMA_CONNECTOR_HPP
00027 
00029 // Headers
00031 #include <Pluma/Config.hpp>
00032 #include <Pluma/Pluma.hpp>
00033 
00034 
00036 // Define portable import/export macros for Plugin registration
00038 #if defined(PLUMA_SYS_WINDOWS)
00039 
00040     #ifndef PLUMA_STATIC_PLUGIN
00041 
00042          // Windows platforms
00043         #ifndef PLUGIN_IMPORTS
00044 
00045             // From DLL side, we must export
00046             #ifdef __cplusplus
00047                #define PLUMA_CONNECTOR extern "C" __declspec(dllexport)
00048             #else
00049                #define PLUMA_CONNECTOR __declspec(dllexport)
00050             #endif
00051 
00052         #else
00053 
00054             // From client application side, we must import
00055             #ifdef __cplusplus
00056                #define PLUMA_CONNECTOR extern "C" __declspec(dllimport)
00057             #else
00058                #define PLUMA_CONNECTOR __declspec(dllimport)
00059             #endif
00060 
00061         #endif
00062 
00063     #else
00064 
00065         // Only define the extern "C" for static build
00066         #ifdef __cplusplus
00067            #define PLUMA_CONNECTOR extern "C"
00068         #else
00069            #define PLUMA_CONNECTOR
00070         #endif
00071 
00072     #endif
00073 
00074 #else
00075 
00076     // Only define the extern "C" for other platforms
00077     #ifdef __cplusplus
00078        #define PLUMA_CONNECTOR extern "C"
00079     #else
00080        #define PLUMA_CONNECTOR
00081     #endif
00082 
00083 #endif
00084 
00085 
00086 #endif // PLUMA_CONNECTOR_HPP