std_single_instance_1.cpp 668 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2019 Peter Dimov.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. #include <boost/config.hpp>
  4. #if defined(STD_SINGLE_INSTANCE_DYN_LINK)
  5. # define EXPORT BOOST_SYMBOL_EXPORT
  6. #else
  7. # define EXPORT
  8. #endif
  9. #include <boost/system/error_code.hpp>
  10. #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
  11. #include <system_error>
  12. namespace lib1
  13. {
  14. EXPORT std::error_code get_system_code()
  15. {
  16. return boost::system::error_code( 0, boost::system::system_category() );
  17. }
  18. EXPORT std::error_code get_generic_code()
  19. {
  20. return boost::system::error_code( 0, boost::system::generic_category() );
  21. }
  22. } // namespace lib1
  23. #else
  24. EXPORT void lib1_f()
  25. {
  26. }
  27. #endif