BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PyCore.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Py/PyCore.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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_BASE_PY_PYCORE_H
21 #define BORNAGAIN_BASE_PY_PYCORE_H
22 
23 #ifdef BORNAGAIN_PYTHON
24 
25 #undef _POSIX_C_SOURCE
26 #undef _XOPEN_SOURCE
27 
28 #ifdef __GNUC__
29 #pragma GCC diagnostic push
30 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
31 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
32 #endif
33 
34 #include <Python.h>
35 #define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY
36 #define NO_IMPORT_ARRAY
37 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // to prevent spurious warning
38 #include <numpy/arrayobject.h>
39 
40 #include "auto/Wrap/swig_runtime.h"
41 
42 #ifdef __GNUC__
43 #pragma GCC diagnostic pop
44 #endif
45 
46 #endif // BORNAGAIN_PYTHON
47 
48 #endif // BORNAGAIN_BASE_PY_PYCORE_H
49 #endif // USER_API