dll_test_lib.cpp 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2018 Peter Dimov
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. //
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. #include <boost/shared_ptr.hpp>
  8. #include <boost/make_shared.hpp>
  9. #include <boost/config.hpp>
  10. #include <memory>
  11. #if defined(DLL_TEST_DYN_LINK)
  12. # define EXPORT BOOST_SYMBOL_EXPORT
  13. #else
  14. # define EXPORT
  15. #endif
  16. EXPORT boost::shared_ptr<int> dll_test_41()
  17. {
  18. return boost::shared_ptr<int>( new int( 41 ) );
  19. }
  20. EXPORT boost::shared_ptr<int> dll_test_42()
  21. {
  22. return boost::make_shared<int>( 42 );
  23. }
  24. EXPORT boost::shared_ptr<int> dll_test_43()
  25. {
  26. return boost::allocate_shared<int>( std::allocator<int>(), 43 );
  27. }
  28. EXPORT boost::shared_ptr<int[]> dll_test_44()
  29. {
  30. return boost::make_shared<int[1]>( 44 );
  31. }
  32. EXPORT boost::shared_ptr<int[]> dll_test_45()
  33. {
  34. return boost::allocate_shared<int[1]>( std::allocator<int>(), 45 );
  35. }