]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: add __USE_BSD to ftdm_os, needed by unistd.h for usleep() and string.h to...
authorMoises Silva <moy@sangoma.com>
Sat, 18 Dec 2010 01:27:37 +0000 (20:27 -0500)
committerMoises Silva <moy@sangoma.com>
Sat, 18 Dec 2010 01:27:37 +0000 (20:27 -0500)
 add -Werror even when the compiler is unknown. This is just a work-around to gcc not being detected
 as GNU by our current standalone build (not bootstrapped through FreeSWITCH)

libs/freetdm/Makefile.am
libs/freetdm/configure.ac
libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
libs/freetdm/src/include/ftdm_os.h
libs/freetdm/src/testsangomaboost.c

index af26f7f2af8c171989144ce7c381ee2b48912666..5e804b750582cca365beea83c145c1dffc87e99f 100644 (file)
@@ -49,6 +49,7 @@ if HAVE_SNG_ISDN
 INCS += -I/usr/include/sng_isdn
 endif 
 
+# we needed to separate CFLAGS in FTDM_COMPAT_CFLAGS and FTDM_CFLAGS due to -c99 which causes problems with wanpipe headers
 FTDM_COMPAT_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_COMPAT_CFLAGS@ @DEFS@
 FTDM_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_CFLAGS@ @DEFS@
 COMPILE   = $(CC) $(FTDM_CFLAGS)
@@ -183,8 +184,8 @@ ftmod_analog_em_la_LIBADD  = libfreetdm.la
 if HAVE_LIBSANGOMA
 mod_LTLIBRARIES += ftmod_wanpipe.la
 ftmod_wanpipe_la_SOURCES = $(SRC)/ftmod/ftmod_wanpipe/ftmod_wanpipe.c
-#some structures within Wanpipe drivers are not c99 compatible, so we need to compile ftmod_wanpipe
-#without c99 flags
+# some structures within Wanpipe drivers are not c99 compatible, so we need to compile ftmod_wanpipe
+# without c99 flags, use FTDM_COMPAT_CFLAGS instead
 ftmod_wanpipe_la_CFLAGS  = $(AM_CFLAGS) $(FTDM_COMPAT_CFLAGS) -D__LINUX__ -I/usr/include/wanpipe
 ftmod_wanpipe_la_LDFLAGS = -shared -module -avoid-version -lsangoma
 ftmod_wanpipe_la_LIBADD  = libfreetdm.la
index 592dfd82a3bbfb3277a92e23caf48610dd3d26c3..e26f10b0b249015b045da9ff6c6328672ccb159e 100644 (file)
@@ -82,7 +82,7 @@ sun)
        fi
        ;;
 *)
-       COMP_VENDOR_COMPAT_CFLAGS="-Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
+       COMP_VENDOR_COMPAT_CFLAGS="-Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
        COMP_VENDOR_CFLAGS="-std=c99 $COMP_VENDOR_COMPAT_CFLAGS"
        ;;
 esac
index f40196499c151b0d517e0e7c6a4c945e7346430d..09208f8d2ce6e7ee0e0ba60f03854bf79cad58c0 100644 (file)
@@ -31,7 +31,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #include "private/ftdm_core.h"
 #include "ftmod_zt.h"
 
index 5026bb72361647565d50056e442af6b772528186..f3ebee9ea2cd1ecc78d2c54749878205c3538159 100644 (file)
 extern "C" {
 #endif
 
+#if defined(__linux__) && !defined(__USE_BSD)
+#define __USE_BSD
+#endif
+
 #include "ftdm_declare.h"
 #include "ftdm_threadmutex.h"
-
 #include <string.h>
 
 #ifndef __WINDOWS__
index b254a08bb814562672d83b3a6758fc4dba505437..b007fc186b73988df4cf9d076d703510a9335e63 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#if defined(__linux__) && !defined(__USE_BSD)
-#define __USE_BSD
-#endif
-#ifndef WIN32
-#include <unistd.h>
-#endif
+
 #include "freetdm.h"