shithub: aubio

Download patch

ref: f7e30e8523d0123ca738ac2c16982732c87e0615
parent: 2d00e5c7dbd07b756b433c2736bc2a3ece74ddfb
author: Paul Brossier <[email protected]>
date: Sun Dec 18 06:26:58 EST 2016

python/ext/aubiomodule.c: fix version string on windows

--- a/python/ext/aubiomodule.c
+++ b/python/ext/aubiomodule.c
@@ -2,6 +2,10 @@
 #include "aubio-types.h"
 #include "py-musicutils.h"
 
+// this dummy macro is used to convince windows that a string passed as -D flag
+// is just that, a string, and not a double.
+#define DEFINEDSTRING(x) #x
+
 static char aubio_module_doc[] = "Python module for the aubio library";
 
 static char Py_alpha_norm_doc[] = ""
@@ -323,7 +327,7 @@
   PyModule_AddObject (m, "sink", (PyObject *) & Py_sinkType);
 
   PyModule_AddStringConstant(m, "float_type", AUBIO_NPY_SMPL_STR);
-  PyModule_AddStringConstant(m, "__version__", AUBIO_VERSION);
+  PyModule_AddStringConstant(m, "__version__", DEFINEDSTRING(AUBIO_VERSION));
 
   // add generated objects
   add_generated_objects(m);