config.hpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // (C) Copyright Samuli-Petrus Korhonen 2017.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // The author gratefully acknowleges the support of NMR Solutions, Inc., in
  7. // producing this work.
  8. // Revision History:
  9. // 15 Feb 17 Initial version
  10. #ifndef CONFIG_NUMPY20170215_H_
  11. # define CONFIG_NUMPY20170215_H_
  12. # include <boost/config.hpp>
  13. /*****************************************************************************
  14. *
  15. * Set up dll import/export options:
  16. *
  17. ****************************************************************************/
  18. // backwards compatibility:
  19. #ifdef BOOST_NUMPY_STATIC_LIB
  20. # define BOOST_NUMPY_STATIC_LINK
  21. # elif !defined(BOOST_NUMPY_DYNAMIC_LIB)
  22. # define BOOST_NUMPY_DYNAMIC_LIB
  23. #endif
  24. #if defined(BOOST_NUMPY_DYNAMIC_LIB)
  25. # if defined(BOOST_SYMBOL_EXPORT)
  26. # if defined(BOOST_NUMPY_SOURCE)
  27. # define BOOST_NUMPY_DECL BOOST_SYMBOL_EXPORT
  28. # define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT
  29. # define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT
  30. # define BOOST_NUMPY_BUILD_DLL
  31. # else
  32. # define BOOST_NUMPY_DECL BOOST_SYMBOL_IMPORT
  33. # define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT
  34. # define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT
  35. # endif
  36. # endif
  37. #endif
  38. #ifndef BOOST_NUMPY_DECL
  39. # define BOOST_NUMPY_DECL
  40. #endif
  41. #ifndef BOOST_NUMPY_DECL_FORWARD
  42. # define BOOST_NUMPY_DECL_FORWARD
  43. #endif
  44. #ifndef BOOST_NUMPY_DECL_EXCEPTION
  45. # define BOOST_NUMPY_DECL_EXCEPTION
  46. #endif
  47. // enable automatic library variant selection ------------------------------//
  48. #if !defined(BOOST_NUMPY_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NUMPY_NO_LIB)
  49. //
  50. // Set the name of our library, this will get undef'ed by auto_link.hpp
  51. // once it's done with it:
  52. //
  53. #define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m
  54. #define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m)
  55. #define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION)
  56. //
  57. // If we're importing code from a dll, then tell auto_link.hpp about it:
  58. //
  59. #ifdef BOOST_NUMPY_DYNAMIC_LIB
  60. # define BOOST_DYN_LINK
  61. #endif
  62. //
  63. // And include the header that does the work:
  64. //
  65. #include <boost/config/auto_link.hpp>
  66. #endif // auto-linking disabled
  67. #undef BOOST_PYTHON_CONCAT
  68. #undef _BOOST_PYTHON_CONCAT
  69. #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  70. #endif // CONFIG_NUMPY20170215_H_