Fixed build on systems where timezone is not an integer type variable.

git-svn-id: http://voip.null.ro/svn/yate@5944 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2015-02-26 09:53:31 +00:00
parent 3cd286e39f
commit cebcd93fa9
3 changed files with 19 additions and 1 deletions

View File

@ -191,6 +191,20 @@ HAVE_GMTOFF="-DHAVE_GMTOFF"
fi
AC_SUBST(HAVE_GMTOFF)
HAVE_INT_TZ=""
AC_MSG_CHECKING([for integer timezone variable])
have_tzint="no"
AC_TRY_COMPILE([
#include <time.h>
],[
long tz = -timezone;
],have_tzint="yes")
AC_MSG_RESULT([$have_tzint])
if [[ "$have_tzint" = "yes" ]]; then
HAVE_INT_TZ="-DHAVE_INT_TZ"
fi
AC_SUBST(HAVE_INT_TZ)
HAVE_POLL=no
AC_ARG_ENABLE(poll,AC_HELP_STRING([--enable-poll],[Use poll() on sockets (default: yes)]),want_poll=$enableval,want_poll=yes)
if [[ "x$want_poll" = "xyes" ]]; then

View File

@ -113,7 +113,7 @@ Thread.o: @srcdir@/Thread.cpp $(MKDEPS) $(CINC)
$(COMPILE) @THREAD_KILL@ @HAVE_PRCTL@ -c $<
TelEngine.o: @srcdir@/TelEngine.cpp $(MKDEPS) $(CINC)
$(COMPILE) @ATOMIC_OPS@ @HAVE_GMTOFF@ -c $<
$(COMPILE) @ATOMIC_OPS@ @HAVE_GMTOFF@ @HAVE_INT_TZ@ -c $<
Client.o: @srcdir@/Client.cpp $(MKDEPS) $(CLINC)
$(COMPILE) -c $<

View File

@ -847,7 +847,11 @@ int Time::timeZone()
if (localtime_r(&time,&t))
return t.tm_gmtoff;
#endif
#ifdef HAVE_INT_TZ
return -timezone;
#else
return 0;
#endif
#endif
}