unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* strptime prototype
@ 2004-03-06 23:07 Kevin Ryde
  0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2004-03-06 23:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

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.


[-- Attachment #2: stime.c.strptime-decl.diff --]
[-- Type: text/plain, Size: 404 bytes --]

--- 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 @@
 
 \f
 
+#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
 

[-- Attachment #3: configure.in.strptime-decl.diff --]
[-- Type: text/plain, Size: 543 bytes --]

--- 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,

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-06 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-06 23:07 strptime prototype Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).