abi_test.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // (C) Copyright John Maddock 2003.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for the most recent version.
  6. #ifndef BOOST_ABI_TEST_HPP
  7. #define BOOST_ABI_TEST_HPP
  8. #include <boost/config.hpp>
  9. #include <boost/cstdint.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. #include BOOST_ABI_PREFIX
  12. #endif
  13. //
  14. // the following class is designed to break if the ABI
  15. // it's compiled with does not match that of the client
  16. // calling it....
  17. //
  18. struct empty{};
  19. class abi_test : protected empty
  20. {
  21. private:
  22. empty e;
  23. char c;
  24. boost::int32_t i;
  25. public:
  26. inline char inline_one()const
  27. { return c; }
  28. inline boost::int32_t inline_two()const
  29. { return i; }
  30. virtual char virtual_one()const;
  31. virtual boost::int32_t virtual_two()const;
  32. abi_test();
  33. };
  34. #ifdef BOOST_HAS_ABI_HEADERS
  35. #include BOOST_ABI_SUFFIX
  36. #endif
  37. #endif // BOOST_ABI_TEST_HPP