shithub: aubio

Download patch

ref: dffe76f2c700d1cfac23b01f9f501f510c6d70ce
parent: b16fc82d8bdcc7668e31ce776aabc9237a422c0c
author: Paul Brossier <piem@piem.org>
date: Thu Sep 17 03:14:19 EDT 2009

src/aubio_priv.h: add AUBIO_WRN, add message to _WRN and _ERR, use double precision functions if AUBIO_SINGLE_PRECISION is not defined

--- a/src/aubio_priv.h
+++ b/src/aubio_priv.h
@@ -105,13 +105,15 @@
 } aubio_status;
 
 #ifdef HAVE_C99_VARARGS_MACROS
-#define AUBIO_ERR(...)               fprintf(stderr,__VA_ARGS__)
-#define AUBIO_MSG(...)               fprintf(stdout,__VA_ARGS__)
-#define AUBIO_DBG(...)               fprintf(stderr,__VA_ARGS__)
+#define AUBIO_ERR(...)               fprintf(stderr, "AUBIO ERROR: " __VA_ARGS__)
+#define AUBIO_MSG(...)               fprintf(stdout, __VA_ARGS__)
+#define AUBIO_DBG(...)               fprintf(stderr, __VA_ARGS__)
+#define AUBIO_WRN(...)               fprintf(stderr, "AUBIO WARNING: " __VA_ARGS__)
 #else
-#define AUBIO_ERR(format, args...)   fprintf(stderr, format , ##args)
+#define AUBIO_ERR(format, args...)   fprintf(stderr, "AUBIO ERROR: " format , ##args)
 #define AUBIO_MSG(format, args...)   fprintf(stdout, format , ##args)
 #define AUBIO_DBG(format, args...)   fprintf(stderr, format , ##args)
+#define AUBIO_WRN(...)               fprintf(stderr, "AUBIO WARNING: " format, ##args)
 #endif
 
 #define AUBIO_QUIT(_s)               exit(_s)
@@ -122,6 +124,7 @@
 #define TWO_PI     (PI*2.)
 
 /* aliases to math.h functions */
+#if AUBIO_SINGLE_PRECISION
 #define EXP        expf
 #define COS        cosf
 #define SIN        sinf
@@ -132,10 +135,22 @@
 #define LOG        logf
 #define FLOOR      floorf
 #define CEIL       ceilf
+#else
+#define EXP        exp
+#define COS        cos
+#define SIN        sin
+#define ABS        fabs
+#define POW        pow
+#define SQRT       sqrt
+#define LOG10      log10
+#define LOG        log
+#define FLOOR      floor
+#define CEIL       ceil
+#endif
 #define ROUND(x)   FLOOR(x+.5)
 
 /* aliases to complex.h functions */
-#if !defined(HAVE_COMPLEX_H) || defined(WIN32)
+#if !defined(AUBIO_SINGLE_PRECISION) || !defined(HAVE_COMPLEX_H) || defined(WIN32)
 /* mingw32 does not know about c*f functions */
 #define EXPC      cexp
 /** complex = CEXPC(complex) */