python/ext/aubiomodule.c: fix version string on windows
authorPaul Brossier <piem@piem.org>
Sun, 18 Dec 2016 10:26:58 +0000 (11:26 +0100)
committerPaul Brossier <piem@piem.org>
Sun, 18 Dec 2016 10:26:58 +0000 (11:26 +0100)
python/ext/aubiomodule.c

index 82674da..ec1177c 100644 (file)
@@ -2,6 +2,10 @@
 #include "aubio-types.h"
 #include "py-musicutils.h"
 
 #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[] = ""
 static char aubio_module_doc[] = "Python module for the aubio library";
 
 static char Py_alpha_norm_doc[] = ""
@@ -323,7 +327,7 @@ initaubio (void)
   PyModule_AddObject (m, "sink", (PyObject *) & Py_sinkType);
 
   PyModule_AddStringConstant(m, "float_type", AUBIO_NPY_SMPL_STR);
   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);
 
   // add generated objects
   add_generated_objects(m);