xtl_config.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /***************************************************************************
  2. * Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
  3. * Copyright (c) QuantStack *
  4. * *
  5. * Distributed under the terms of the BSD 3-Clause License. *
  6. * *
  7. * The full license is in the file LICENSE, distributed with this software. *
  8. ****************************************************************************/
  9. #ifndef XTL_CONFIG_HPP
  10. #define XTL_CONFIG_HPP
  11. #define XTL_VERSION_MAJOR 0
  12. #define XTL_VERSION_MINOR 7
  13. #define XTL_VERSION_PATCH 7
  14. #ifndef __has_feature
  15. #define __has_feature(x) 0
  16. #endif
  17. // Attempt to discover whether we're being compiled with exception support
  18. #if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(XTL_NO_EXCEPTIONS)
  19. // Exceptions are enabled.
  20. #else
  21. #if !defined(XTL_NO_EXCEPTIONS)
  22. // Exceptions are disabled.
  23. #define XTL_NO_EXCEPTIONS
  24. #endif
  25. #endif
  26. #if defined(XTL_NO_EXCEPTIONS)
  27. #include <iostream>
  28. #define XTL_THROW(_, msg) \
  29. { \
  30. std::cerr << msg << std::endl; \
  31. std::abort(); \
  32. }
  33. #else
  34. #define XTL_THROW(exception, msg) throw exception(msg)
  35. #endif
  36. #endif