aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-04-08 16:59:24 +0200
committerHarald Welte <laforge@gnumonks.org>2012-04-08 16:59:24 +0200
commit9c3dc90d16a40789081c84e46620f4d66689fec1 (patch)
tree69fba13dafd13f1429b8539cba097ea18d2beb10 /openbsc/src/libmsc/gsm_04_08.c
parenta334c296e02852880148abf92abf12c63ed49b3b (diff)
introduce HAVE_TM_GMTOFF_IN_TM
Not all architectures have the tm.tm_gmtoff member. This fixes cygwin builds.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_08.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 20a2cc502..e596b210d 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -29,6 +29,8 @@
#include <time.h>
#include <netinet/in.h>
+#include "bscconfig.h"
+
#include <openbsc/auth.h>
#include <openbsc/db.h>
#include <openbsc/debug.h>
@@ -734,7 +736,12 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
/* Need to get GSM offset and convert into 15 min units */
/* This probably breaks if gmtoff returns a value not evenly divisible by 15? */
local_time = localtime(&cur_t);
+#ifdef HAVE_TM_GMTOFF_IN_TM
tzunits = (local_time->tm_gmtoff/60)/15;
+#else
+#warning find a portable way to obtain the timezone offset
+ tzunits = 0;
+#endif
if (tzunits < 0) {
tzunits = tzunits/-1;
ptr8[7] = bcdify(tzunits);