Pavol Rusnak <stick@gk2.sk>:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2008 16:05:17 +0000 (16:05 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2008 16:05:17 +0000 (16:05 +0000)
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).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24044 f5534014-38df-0310-8fa8-9805f1628bb7

text2pcap.c

index ee44fac128154eef34090087016bf55816a762ca..e8d1252f204ed4c1272aee5a1b9175e87b96feb4 100644 (file)
 # 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
 #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>