BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PythonCore.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Base/Utils/PythonCore.h
6 //! @brief Includes python header and takes care of warnings.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_BASE_UTILS_PYTHONCORE_H
16 #define BORNAGAIN_BASE_UTILS_PYTHONCORE_H
17 
18 #ifdef BORNAGAIN_PYTHON
19 
20 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
21 
22 #undef _POSIX_C_SOURCE
23 #undef _XOPEN_SOURCE
24 
25 #ifdef __GNUC__
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
28 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29 #endif
30 
31 #include <Python.h>
32 #define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY
33 #define NO_IMPORT_ARRAY
34 #include <numpy/arrayobject.h>
35 
36 #include "auto/Wrap/swig_runtime.h"
37 
38 #ifdef __GNUC__
39 #pragma GCC diagnostic pop
40 #endif
41 
42 #endif // BORNAGAIN_PYTHON
43 
44 #endif // BORNAGAIN_BASE_UTILS_PYTHONCORE_H