<< "{" << std::endl << "}" << std::endl;
*/
+#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+ std::string export_prefix = "__declspec(dllexport)";
+#else // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+ std::string export_prefix = "__attribute__((visibility(\"default\")))";
+#endif // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+
// Write access function
out_stream
<< std::endl
- << "extern \"C\" __declspec(dllexport) const char* "
+ << "extern \"C\" " << export_prefix << " const char* "
<< "cpPlugins_LoadedFilters( )" << std::endl << "{" << std::endl
<< " static std::string classes;"
<< std::endl
for( auto jIt = iIt->second.begin( ); jIt != iIt->second.end( ); ++jIt )
{
out_stream
- << "extern \"C\" __declspec(dllexport) void* "
+ << "extern \"C\" " << export_prefix << " void* "
<< iIt->first << "_" << jIt->first
<< "( )" << std::endl << "{" << std::endl
<< " static " << jIt->second << "::" << jIt->first << "::Pointer f;" << std::endl