guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strptime prototype


From: Kevin Ryde
Subject: strptime prototype
Date: Sun, 07 Mar 2004 09:07:01 +1000
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

glibc has a prototype for strptime in time.h, but needs _GNU_SOURCE to
give it.

        * stime.c: Define _GNU_SOURCE for strptime prototype from glibc.  Use
        HAVE_DECL_STRPTIME for when to give own prototype.

        * configure.in (strptime): Use #define _GNU_SOURCE to get the
        prototype from glibc, use AC_CHECK_DECLS rather than AC_EGREP_HEADER.

--- stime.c.~1.85.~     2004-03-03 10:11:33.000000000 +1000
+++ stime.c     2004-03-07 09:04:24.000000000 +1000
@@ -18,6 +18,8 @@
 
 
 
+#define _GNU_SOURCE  /* ask glibc for everything, in particular strptime */
+
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif
@@ -65,7 +67,7 @@
 # define tzname _tzname
 #endif
 
-#ifdef MISSING_STRPTIME_DECL
+#if ! HAVE_DECL_STRPTIME
 extern char *strptime ();
 #endif
 
--- configure.in.~1.235.~       2004-02-29 06:07:24.000000000 +1000
+++ configure.in        2004-03-03 10:29:40.000000000 +1000
@@ -649,10 +649,13 @@
   fi
 ])
 
-GUILE_FUNC_DECLARED(strptime, time.h)
 GUILE_FUNC_DECLARED(sleep, unistd.h)
 GUILE_FUNC_DECLARED(usleep, unistd.h)
 
+AC_CHECK_DECLS([strptime],,,
+[#define _GNU_SOURCE
+#include <time.h>])
+
 ### On some systems usleep has no return value.  If it does have one,
 ### we'd like to return it; otherwise, we'll fake it.
 AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]