internal.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright Jim Bosch 2010-2012.
  2. // Copyright Stefan Seefeld 2016.
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef boost_python_numpy_internal_hpp_
  7. #define boost_python_numpy_internal_hpp_
  8. /**
  9. * @file boost/python/numpy/internal.hpp
  10. * @brief Internal header file to include the Numpy C-API headers.
  11. *
  12. * This should only be included by source files in the boost.numpy library itself.
  13. */
  14. #include <boost/python.hpp>
  15. #include <boost/python/numpy/config.hpp>
  16. #ifdef BOOST_PYTHON_NUMPY_INTERNAL
  17. #define NO_IMPORT_ARRAY
  18. #define NO_IMPORT_UFUNC
  19. #else
  20. #ifndef BOOST_PYTHON_NUMPY_INTERNAL_MAIN
  21. ERROR_internal_hpp_is_for_internal_use_only
  22. #endif
  23. #endif
  24. #define PY_ARRAY_UNIQUE_SYMBOL BOOST_NUMPY_ARRAY_API
  25. #define PY_UFUNC_UNIQUE_SYMBOL BOOST_UFUNC_ARRAY_API
  26. #include <numpy/arrayobject.h>
  27. #include <numpy/ufuncobject.h>
  28. #include <boost/python/numpy.hpp>
  29. #define NUMPY_OBJECT_MANAGER_TRAITS_IMPL(pytype,manager) \
  30. PyTypeObject const * object_manager_traits<manager>::get_pytype() { return &pytype; }
  31. #endif