]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ftmod_libpri: Check for required features in configure and remove old-style log callbacks
authorStefan Knoblich <stkn@openisdn.net>
Fri, 13 Apr 2012 23:39:25 +0000 (01:39 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Fri, 13 Apr 2012 23:39:25 +0000 (01:39 +0200)
Non-PRI_NEW_SET_API logging callbacks were only available in libpri-1.0 and older,
which also lacks PRI_IO_FUNCS (required) and wouldn't work anyway.

Explicitly check for both PRI_* feature defines at configure time and reject libpri
versions that lack them.

Remove the non-PRI_NEW_SET_API logging callbacks in ftmod_libpri.c.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/configure.ac
libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c

index d166233f00e06b619e83278907cc76341870527d..a888d20ef4fdfdaeebd1e69d553330d0b44fbbb6 100644 (file)
@@ -236,6 +236,21 @@ then
                 AC_MSG_ERROR([libpri not found or unusable (see config.log for details)])]
        )
 
+       AC_MSG_CHECKING([whether libpri is too old])
+       AC_PREPROC_IFELSE(
+               [AC_LANG_PROGRAM(
+                       [#include <libpri.h>],
+                       [#if !defined(PRI_IO_FUNCS)
+                        #error "libpri is lacking PRI_IO_FUNCS"
+                        #elif !defined(PRI_NEW_SET_API)
+                        #error "libpri is lacking PRI_NEW_SET_API"
+                        #endif]
+                )],
+               [AC_MSG_RESULT([no])],
+               [AC_MSG_RESULT([yes])
+                AC_MSG_ERROR([Your version of libpri is too old (pre 1.2), please update!])]
+       )
+
        AC_MSG_CHECKING([whether libpri has BRI support])
        AC_LINK_IFELSE(
                [AC_LANG_PROGRAM(
index b8871cf70cef643787ed2a3c688d3cdea6ca1d61..2e11f52f2602904ecbc69dfdef8ef850baa6e151 100644 (file)
@@ -115,7 +115,6 @@ static FIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request)
 }
 
 
-#ifdef PRI_NEW_SET_API
 /**
  * \brief Logs a libpri message
  * \param pri  libpri structure
@@ -147,25 +146,6 @@ static void s_pri_error(struct pri *pri, char *s)
                ftdm_log(FTDM_LOG_ERROR, "%s", s);
        }
 }
-#else  /* !PRI_NEW_SET_API */
-/**
- * \brief Logs a libpri message
- * \param s    Message string
- */
-static void s_pri_message(char *s)
-{
-       ftdm_log(FTDM_LOG_DEBUG, "%s", s);
-}
-
-/**
- * \brief Logs a libpri error
- * \param s    Error string
- */
-static void s_pri_error(char *s)
-{
-       ftdm_log(FTDM_LOG_ERROR, "%s", s);
-}
-#endif
 
 
 #define PRI_DEBUG_Q921_ALL     (PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_STATE)