OLD | NEW |
1 %insert(runtime) %{ | 1 %insert(runtime) %{ |
2 /* Python.h has to appear first */ | 2 /* Python.h has to appear first */ |
| 3 |
3 // Resolve conflicting use of _DEBUG across projects. | 4 // Resolve conflicting use of _DEBUG across projects. |
4 // #defining _DEBUG causes Python.h to require pythonXX_d.lib (instead | 5 // #defining _DEBUG causes Python.h to require pythonXX_d.lib (instead |
5 // of pythonXX.lib). | 6 // of pythonXX.lib). |
6 // MSVC #defines _DEBUG for Debug configuration. | 7 // MSVC #defines _DEBUG for Debug configuration. |
7 // Make sure our project, which uses the latter, doesn't trigger the | 8 // Make sure our project, which uses the latter, doesn't trigger the |
8 // former since we don't want to debug python itself. | 9 // former since we don't want to debug python itself. |
9 // (http://old.nabble.com/problems-with-python24_d.lib-td4760095.html#a4760095) | 10 // (http://old.nabble.com/problems-with-python24_d.lib-td4760095.html#a4760095) |
10 // Also, disable a check in MSVC when building for Multi-threaded Debug DLL | 11 |
| 12 // Disable a check in MSVC when building for Multi-threaded Debug DLL |
11 // that complains about mix of headers with and without _DEBUG. | 13 // that complains about mix of headers with and without _DEBUG. |
| 14 |
| 15 // On the Mac, use <Python/Python.h> because that is required as of 10.9. |
| 16 // https://sourceforge.net/p/swig/bugs/1346/ |
12 #ifdef _DEBUG | 17 #ifdef _DEBUG |
13 #if defined(_MSC_VER) && _MSC_VER >= 1400 | 18 # if defined(_MSC_VER) && _MSC_VER >= 1400 |
14 #define _CRT_NOFORCE_MANIFEST 1 | 19 # define _CRT_NOFORCE_MANIFEST 1 |
15 #endif | 20 # endif |
16 #undef _DEBUG | 21 # undef _DEBUG |
17 #include <Python.h> | 22 # if defined(__APPLE__) |
18 #define _DEBUG | 23 # include <Python/Python.h> |
| 24 # else |
| 25 # include <Python.h> |
| 26 # endif |
| 27 # define _DEBUG |
19 #else | 28 #else |
20 #include <Python.h> | 29 # if defined(__APPLE__) |
| 30 # include <Python/Python.h> |
| 31 # else |
| 32 # include <Python.h> |
| 33 # endif |
21 #endif | 34 #endif |
22 %} | 35 %} |
23 | 36 |
24 %insert(runtime) "swigrun.swg"; /* SWIG API */ | 37 %insert(runtime) "swigrun.swg"; /* SWIG API */ |
25 %insert(runtime) "swigerrors.swg"; /* SWIG errors */ | 38 %insert(runtime) "swigerrors.swg"; /* SWIG errors */ |
26 %insert(runtime) "pyhead.swg"; /* Python includes and fixes */ | 39 %insert(runtime) "pyhead.swg"; /* Python includes and fixes */ |
27 %insert(runtime) "pyerrors.swg"; /* Python errors */ | 40 %insert(runtime) "pyerrors.swg"; /* Python errors */ |
28 %insert(runtime) "pythreads.swg"; /* Python thread code */ | 41 %insert(runtime) "pythreads.swg"; /* Python thread code */ |
29 %insert(runtime) "pyapi.swg"; /* Python API */ | 42 %insert(runtime) "pyapi.swg"; /* Python API */ |
30 %insert(runtime) "pyrun.swg"; /* Python run-time code */ | 43 %insert(runtime) "pyrun.swg"; /* Python run-time code */ |
31 | 44 |
OLD | NEW |