Bug 266 - Fails to compile on systems without strptime
Fails to compile on systems without strptime
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: NSD Code
3.2.x
i386 other
: P2 minor
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-06 21:49 CEST by Philip Homburg
Modified: 2009-08-07 09:18 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Homburg 2009-08-06 21:49:19 CEST
config.h has a prototype for strptime and defines strptime as nsd_strptime for systems that lack this function.

Answer.c (indirectly) includes config.h twice. This results in a garbled declaration for strptime the second time config.h is included.
Comment 1 Matthijs Mekking 2009-08-07 09:18:24 CEST
I made this patch in configure.ac. This should solve the issue.

Index: configure.ac
===================================================================
--- configure.ac	(revision 2899)
+++ configure.ac	(working copy)
@@ -747,9 +747,11 @@
 #include "compat/fake-rfc2553.h"
 #endif
 #ifndef HAVE_STRPTIME
+#define HAVE_STRPTIME 1
 char *strptime(const char *s, const char *format, struct tm *tm); 
 #endif
 #ifndef STRPTIME_WORKS
+#define STRPTIME_WORKS 1
 #define strptime(a,b,c) nsd_strptime((a),(b),(c))
 #endif