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)
6 // The author gratefully acknowleges the support of NMR Solutions, Inc., in
7 // producing this work.
10 // 15 Feb 17 Initial version
12 #ifndef CONFIG_NUMPY20170215_H_
13 # define CONFIG_NUMPY20170215_H_
15 # include <boost/config.hpp>
17 /*****************************************************************************
19 * Set up dll import/export options:
21 ****************************************************************************/
23 // backwards compatibility:
24 #ifdef BOOST_NUMPY_STATIC_LIB
25 # define BOOST_NUMPY_STATIC_LINK
26 # elif !defined(BOOST_NUMPY_DYNAMIC_LIB)
27 # define BOOST_NUMPY_DYNAMIC_LIB
30 #if defined(BOOST_NUMPY_DYNAMIC_LIB)
31 # if defined(BOOST_SYMBOL_EXPORT)
32 # if defined(BOOST_NUMPY_SOURCE)
33 # define BOOST_NUMPY_DECL BOOST_SYMBOL_EXPORT
34 # define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT
35 # define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT
36 # define BOOST_NUMPY_BUILD_DLL
38 # define BOOST_NUMPY_DECL BOOST_SYMBOL_IMPORT
39 # define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT
40 # define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT
46 #ifndef BOOST_NUMPY_DECL
47 # define BOOST_NUMPY_DECL
50 #ifndef BOOST_NUMPY_DECL_FORWARD
51 # define BOOST_NUMPY_DECL_FORWARD
54 #ifndef BOOST_NUMPY_DECL_EXCEPTION
55 # define BOOST_NUMPY_DECL_EXCEPTION
58 // enable automatic library variant selection ------------------------------//
60 #if !defined(BOOST_NUMPY_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NUMPY_NO_LIB)
62 // Set the name of our library, this will get undef'ed by auto_link.hpp
63 // once it's done with it:
65 #define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m
66 #define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m)
67 #define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION)
69 // If we're importing code from a dll, then tell auto_link.hpp about it:
71 #ifdef BOOST_NUMPY_DYNAMIC_LIB
72 # define BOOST_DYN_LINK
75 // And include the header that does the work:
77 #include <boost/config/auto_link.hpp>
78 #endif // auto-linking disabled
80 #undef BOOST_PYTHON_CONCAT
81 #undef _BOOST_PYTHON_CONCAT
83 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
85 #endif // CONFIG_NUMPY20170215_H_