summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-12-14 02:49:55 +0100
committerGravatar Nikias Bassen2016-12-14 02:49:55 +0100
commitd53d0412e014872b71dd9c91727234de4f08fb2f (patch)
treeec03b25a1d712bf23b78a613384c75a9191bb272 /src
parentae8b7a0f1a5cf569f52f35fc1f113d0c4f354f6e (diff)
downloadlibplist-d53d0412e014872b71dd9c91727234de4f08fb2f.tar.gz
libplist-d53d0412e014872b71dd9c91727234de4f08fb2f.tar.bz2
Properly check for the availability of strptime() and make sure to use it
Diffstat (limited to 'src')
-rw-r--r--src/xplist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c
index dc824e2..43b0422 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -25,6 +25,10 @@
#include <config.h>
#endif
+#ifdef HAVE_STRPTIME
+#define _XOPEN_SOURCE 600
+#endif
+
#include <string.h>
#include <assert.h>
#include <stdlib.h>
@@ -354,7 +358,7 @@ static void parse_date(const char *strval, struct TM *btime)
if (!btime) return;
memset(btime, 0, sizeof(struct tm));
if (!strval) return;
-#ifdef strptime
+#ifdef HAVE_STRPTIME
strptime((char*)strval, "%Y-%m-%dT%H:%M:%SZ", btime);
#else
#ifdef USE_TM64