Changeset 5215c01


Ignore:
Timestamp:
Aug 9, 2005, 4:21:02 AM (16 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
ccfafb2
Parents:
cad8783
Message:

add c99 varargs checks, thanks to Mo DeJong?

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rcad8783 r5215c01  
    1 dnl Process this file with autoconf to porduce a configure script
     1dnl Process this file with autoconf to produce a configure script
    22
    33AC_INIT(src/aubio.h)
     
    99
    1010AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
     11AM_MAINTAINER_MODE
    1112
    1213AC_PREFIX_DEFAULT(/usr)
     
    8182AC_CHECK_HEADERS(complex.h,,AC_MSG_ERROR([Ouch! missing complex.h header]))
    8283AC_CHECK_HEADERS(fftw3.h  ,,AC_MSG_ERROR([Ouch! missing fftw3.h headeri]))
     84
     85AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
     86    ac_cv_varargs_macros,
     87AC_TRY_COMPILE([
     88  #include <stdio.h>
     89  #define AUBIO_ERR(...)                       fprintf(stderr, __VA_ARGS__)
     90],
     91[
     92  AUBIO_ERR("%s\n", "ERR");
     93],
     94        ac_cv_varargs_macros=yes,
     95        ac_cv_varargs_macros=no)
     96)
     97if test "$ac_cv_varargs_macros" = "yes"; then
     98    AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
     99            [Defined when c99 style varargs macros are supported])
     100fi
     101
    83102
    84103dnl check for pkg-config
     
    154173fi
    155174 
     175AC_ARG_ENABLE(testprogs,
     176  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
     177  [with_testprogs=$enableval],
     178  with_testprogs="no")
     179AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
     180
    156181dnl Check for optional programs
    157182
     
    179204AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
    180205
    181 AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Ouch! puredata header not found]))
     206AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
    182207AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
    183208
     
    187212                ext/Makefile
    188213                examples/Makefile
     214                examples/tests/Makefile
    189215                sounds/Makefile
    190                 swig/Makefile
     216                swig/Makefile
    191217                python/Makefile
    192218                python/aubio/Makefile
  • src/aubio_priv.h

    rcad8783 r5215c01  
    117117} aubio_status;
    118118
    119 #define AUBIO_ERR(...)                                                  fprintf(stderr,__VA_ARGS__)
    120 #define AUBIO_MSG(...)                                                  fprintf(stdout,__VA_ARGS__)
    121 #define AUBIO_DBG(...)                                                  fprintf(stderr,__VA_ARGS__)
    122 #define AUBIO_QUIT(_s)                                                  exit(_s)
    123 #define AUBIO_SPRINTF               sprintf
     119#ifdef HAVE_C99_VARARGS_MACROS
     120#define AUBIO_ERR(...)               fprintf(stderr,__VA_ARGS__)
     121#define AUBIO_MSG(...)               fprintf(stdout,__VA_ARGS__)
     122#define AUBIO_DBG(...)               fprintf(stderr,__VA_ARGS__)
     123#else
     124#define AUBIO_ERR(format, args...)   fprintf(stderr, format , ##args)
     125#define AUBIO_MSG(format, args...)   fprintf(stdout, format , ##args)
     126#define AUBIO_DBG(format, args...)   fprintf(stderr, format , ##args)
     127#endif
     128
     129#define AUBIO_QUIT(_s)               exit(_s)
     130#define AUBIO_SPRINTF                sprintf
    124131
    125132#endif/*_AUBIO_PRIV_H*/
  • src/config.h.in

    rcad8783 r5215c01  
    1212/* Define to enable fftw3 support */
    1313#undef FFTW3_SUPPORT
     14
     15/* Defined when c99 style varargs macros are supported */
     16#undef HAVE_C99_VARARGS_MACROS
    1417
    1518/* Define to 1 if you have the <complex.h> header file. */
Note: See TracChangeset for help on using the changeset viewer.