aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 15:31:35 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 15:31:35 +0000
commitec99b4621efa045e3256d876b4b03ac95b10bc7c (patch)
treea7faeae48084aab872db13fe6cbec9a73b767772
parentd1d3130af7844c62050667e915829a2d8402b989 (diff)
Correctly allow chan_dahdi to compile against older versions of Zaptel.
Don't always define HAVE_ZAPTEL_CHANALARMS (since we check if it's defined..) Minor cleanup to make things clear. (closes issue #13726) Reported by: tzafrir Patches: dahdi_def.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@150557 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_dahdi.c4
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--main/asterisk.c2
-rw-r--r--main/channel.c2
5 files changed, 12 insertions, 16 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 60b6d2d9f..5bd2bd9f7 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -3668,7 +3668,7 @@ static int get_alarms(struct dahdi_pvt *p)
{
int res;
struct dahdi_spaninfo zi;
-#if defined(HAVE_DAHDI) || defined(HAVE_ZAPTEL_CHANALARMS)
+#if !defined(HAVE_ZAPTEL) || defined(HAVE_ZAPTEL_CHANALARMS)
/*
* The conditional compilation is needed only in asterisk-1.4 for
* backward compatibility with old zaptel drivers that don't have
@@ -3687,7 +3687,7 @@ static int get_alarms(struct dahdi_pvt *p)
}
if (zi.alarms != DAHDI_ALARM_NONE)
return zi.alarms;
-#if defined(HAVE_DAHDI) || defined(HAVE_ZAPTEL_CHANALARMS)
+#if !defined(HAVE_ZAPTEL) || defined(HAVE_ZAPTEL_CHANALARMS)
/* No alarms on the span. Check for channel alarms. */
if ((res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &params)) >= 0)
return params.chan_alarms;
diff --git a/configure b/configure
index c6bbbf730..96f17c6af 100755
--- a/configure
+++ b/configure
@@ -12126,11 +12126,13 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -12170,11 +12172,13 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE_SOURCE 1
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -30576,12 +30580,6 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_ZAPTEL_CHANALARMS 1
_ACEOF
- else
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_CHANALARMS 0
-_ACEOF
-
fi
elif test -n "${ZAPTEL_MANDATORY}";
then
diff --git a/configure.ac b/configure.ac
index d73b99d13..de742f95b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1464,8 +1464,6 @@ if test "${USE_ZAPTEL}" != "no" && test "x${PBX_DAHDI}" != "x1"; then
CPPFLAGS="${saved_cppflags}"
if test "${ac_cv_member_ZT_PARAMS_chan_alarms}" = "yes"; then
AC_DEFINE([HAVE_ZAPTEL_CHANALARMS], 1, [Define if your Zaptel drivers have chan_alarms.])
- else
- AC_DEFINE([HAVE_ZAPTEL_CHANALARMS], 0, [Define if your Zaptel drivers have chan_alarms.])
fi
elif test -n "${ZAPTEL_MANDATORY}";
then
diff --git a/main/asterisk.c b/main/asterisk.c
index cee50d677..c7fe4b82e 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -74,7 +74,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <pwd.h>
#include <sys/stat.h>
-#if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI)
+#if defined(HAVE_DAHDI)
#include <sys/ioctl.h>
#include "asterisk/dahdi_compat.h"
#endif
diff --git a/main/channel.c b/main/channel.c
index 1f92ed97f..f23831041 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -37,7 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <math.h>
-#if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI)
+#if defined(HAVE_DAHDI)
#include <sys/ioctl.h>
#include "asterisk/dahdi_compat.h"
#endif