// Copyright 2014 Renato Tegon Forti, Antony Polukhin. // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include //[getting_started_exports_c_function // exporting pure 'C' method extern "C" int BOOST_SYMBOL_EXPORT c_func_name(int); //] //[getting_started_exports_c_variable // exporting POD 'C' variable in global namespace extern "C" int BOOST_SYMBOL_EXPORT c_variable_name; //] //[getting_started_exports_cpp_function // exporting 'C++' function namespace my_namespace { std::string cpp_function_name(const std::string& param); BOOST_DLL_ALIAS( my_namespace::cpp_function_name, cpp_function_alias_name ) } // namespace my_namespace //] #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES //[getting_started_exports_cpp11_function // exporting 'C++11' function namespace my_namespace { int cpp11_function(std::string&& param); } // namespace my_namespace BOOST_DLL_ALIAS( my_namespace::cpp11_function, cpp11_function_alias_name ) //] #endif //[getting_started_exports_cpp_variable // exporting 'C++' variable namespace my_namespace { std::string cpp_variable_name = "some value"; } BOOST_DLL_ALIAS( my_namespace::cpp_variable_name, cpp_variable_alias_name ) //] int c_func_name(int i) { return ++i; } int c_variable_name = 1; namespace my_namespace { std::string cpp_function_name(const std::string& param) { return param + " Hello from lib!"; } #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES int cpp11_function(std::string&& param) { return static_cast(param.size()); } #endif }