From ed04a86611f98b80e16806275268395f1d92d99c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 29 Oct 2013 16:10:19 +0100 Subject: [PATCH] Fix visibility issues when compiling with mingw32. --- configure.ac | 10 ++++++++++ include/bcg729/decoder.h | 2 +- include/bcg729/encoder.h | 2 +- src/Makefile.am | 2 -- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 533f5e3..9a5ce83 100644 --- a/configure.ac +++ b/configure.ac @@ -46,4 +46,14 @@ AC_CONFIG_FILES([ libbcg729.pc ]) +case "$target_os" in + *mingw*) + CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501" + ;; + *) + CFLAGS="$CFLAGS -fvisibility=hidden" + ;; +esac + + AC_OUTPUT diff --git a/include/bcg729/decoder.h b/include/bcg729/decoder.h index 7ebe87b..afe2780 100644 --- a/include/bcg729/decoder.h +++ b/include/bcg729/decoder.h @@ -23,7 +23,7 @@ typedef struct bcg729DecoderChannelContextStruct_struct bcg729DecoderChannelContextStruct; #include -#ifdef _MSC_VER +#ifdef WIN32 #define BCG729_VISIBILITY #else #define BCG729_VISIBILITY __attribute__ ((visibility ("default"))) diff --git a/include/bcg729/encoder.h b/include/bcg729/encoder.h index d7f2dc2..6735a5d 100644 --- a/include/bcg729/encoder.h +++ b/include/bcg729/encoder.h @@ -23,7 +23,7 @@ #include typedef struct bcg729EncoderChannelContextStruct_struct bcg729EncoderChannelContextStruct; -#ifdef _MSC_VER +#ifdef WIN32 #define BCG729_VISIBILITY #else #define BCG729_VISIBILITY __attribute__ ((visibility ("default"))) diff --git a/src/Makefile.am b/src/Makefile.am index f221c93..af0dff0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,5 +27,3 @@ libbcg729_la_SOURCES= LP2LSPConversion.c \ libbcg729_la_LDFLAGS= -no-undefined INCLUDES= -I$(top_srcdir)/include - -AM_CFLAGS=-fvisibility=hidden