Skip to content

Commit

Permalink
Add HAVE_CONFIG_H def. this is useful when embedding the library in o…
Browse files Browse the repository at this point in the history
…ther libs/using the code directly.
  • Loading branch information
talaviram committed Jul 27, 2019
1 parent b1f14c6 commit e4f0618
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include(CheckSymbolExists)
include(CheckTypeSize)
include(CMakePushCheckState)
include(ClipMode)
add_definitions(-DHAVE_CONFIG_H)

set(SAMPLERATE_SRC
${PROJECT_SOURCE_DIR}/src/samplerate.c
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ dnl ============================================================================
dnl Compiler stuff.

AS_IF([test "x$enable_flags_setting" = "xyes"], [
AX_APPEND_COMPILE_FLAGS([-O2 -pipe], [CFLAGS])
AX_APPEND_COMPILE_FLAGS([-DHAVE_CONFIG_H -O2 -pipe], [CFLAGS])
AS_CASE([${host_os}],
[darwin*], [
Expand Down
2 changes: 2 additions & 0 deletions examples/audio_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include <string.h>
#include <unistd.h>

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "audio_out.h"

Expand Down
2 changes: 2 additions & 0 deletions examples/timewarp-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 2 additions & 0 deletions examples/varispeed-play.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include <unistd.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <float_cast.h>

Expand Down
2 changes: 2 additions & 0 deletions src/float_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
** long int lrint (double x) ;
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

/*
** The presence of the required functions are detected during the configure
Expand Down
2 changes: 2 additions & 0 deletions src/samplerate.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "samplerate.h"
#include "float_cast.h"
Expand Down
2 changes: 2 additions & 0 deletions src/src_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "float_cast.h"
#include "common.h"

Expand Down
2 changes: 2 additions & 0 deletions src/src_sinc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "float_cast.h"
#include "common.h"

Expand Down
2 changes: 2 additions & 0 deletions src/src_zoh.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "float_cast.h"
#include "common.h"

Expand Down
2 changes: 2 additions & 0 deletions tests/calc_snr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "util.h"

Expand Down
2 changes: 2 additions & 0 deletions tests/callback_hang_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 2 additions & 0 deletions tests/multi_channel_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 2 additions & 0 deletions tests/multichan_throughput_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include <samplerate.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "util.h"
#include "float_cast.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/snr_bw_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 2 additions & 0 deletions tests/src-evaluate.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#include <string.h>
#include <ctype.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#if (HAVE_FFTW3 && HAVE_SNDFILE && HAVE_SYS_TIMES_H)

Expand Down
2 changes: 2 additions & 0 deletions tests/throughput_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include <samplerate.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "util.h"
#include "float_cast.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define ABS(a) (((a) < 0) ? - (a) : (a))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
Expand Down
2 changes: 2 additions & 0 deletions tests/varispeed_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit e4f0618

Please sign in to comment.