aboutsummaryrefslogtreecommitdiffstats
path: root/text2pcap.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2008-01-09 16:05:17 +0000
committerJörg Mayer <jmayer@loplof.de>2008-01-09 16:05:17 +0000
commit46db55e4e7667fc376215c03d821dc2dc09c1013 (patch)
tree78a25cf1a233e80a35eb368c5a415107a541ea58 /text2pcap.c
parent27a531e06a7e20c852d8a2bd8b3e49474b85f17b (diff)
Pavol Rusnak <stick@gk2.sk>:
Fix for http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2183 Strptime function is not properly included. It needs __USE_XOPEN macro, but it is defined in wrong place. It must be defined before _any_ include file. Otherwise I get "implicit declaration of function `strptime`" (gcc 4.3.0). svn path=/trunk/; revision=24044
Diffstat (limited to 'text2pcap.c')
-rw-r--r--text2pcap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/text2pcap.c b/text2pcap.c
index ee44fac128..e8d1252f20 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -81,12 +81,6 @@
# include "config.h"
#endif
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <wiretap/file_util.h>
-
/*
* Just make sure we include the prototype for strptime as well
* (needed for glibc 2.2) but make sure we do this only if not
@@ -95,6 +89,15 @@
#ifndef __USE_XOPEN
# define __USE_XOPEN
#endif
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wiretap/file_util.h>
#include <time.h>
#include <glib.h>