From: Paul Brossier Date: Mon, 4 Mar 2013 19:28:17 +0000 (-0500) Subject: aubiomodule.c: simplify includes X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7a6521daf3f38207403d27f6b49d4c6a48288ee3;p=aubio.git aubiomodule.c: simplify includes --- diff --git a/python/aubio-types.h b/python/aubio-types.h index 9d38c6e3..b2747a60 100644 --- a/python/aubio-types.h +++ b/python/aubio-types.h @@ -1,13 +1,27 @@ -#include +#include "Python.h" #include -#define NO_IMPORT_ARRAY + //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION -#include + +// define numpy unique symbols for aubio +#define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API +#define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API + +// only import array and ufunc from main module +#ifndef PY_AUBIO_MODULE_MAIN +#define NO_IMPORT_ARRAY +#define NO_IMPORT_UFUNC +#endif + +// import aubio +#include +#include +#include + #define AUBIO_UNSTABLE 1 #include #define Py_default_vector_length 1024 -#define Py_default_vector_height 1 #define Py_aubio_default_samplerate 44100 diff --git a/python/aubiomodule.c b/python/aubiomodule.c index ccbc28ba..293758ab 100644 --- a/python/aubiomodule.c +++ b/python/aubiomodule.c @@ -1,8 +1,4 @@ -#include -#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API -//#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION -#include - +#define PY_AUBIO_MODULE_MAIN #include "aubio-types.h" #include "generated/aubio-generated.h" @@ -246,6 +242,7 @@ init_aubio (void) PyObject *m; int err; + // fvec is defined in __init__.py if ( (PyType_Ready (&Py_cvecType) < 0) || (PyType_Ready (&Py_filterType) < 0) || (PyType_Ready (&Py_filterbankType) < 0) @@ -281,6 +278,6 @@ init_aubio (void) Py_INCREF (&Py_pvocType); PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType); - // generated objects + // add generated objects add_generated_objects(m); }