// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.45 2002/04/26 05:52:27 jgg Exp $
+// $Id: strutl.cc,v 1.46 2002/11/22 07:15:23 doogie Exp $
/* ######################################################################
String Util - Some useful string functions.
#include <errno.h>
#include <stdarg.h>
+#include "config.h"
+
using namespace std;
/*}}}*/
Contributed by Roger Beeman <beeman@cisco.com>, with the help of
Mark Baushke <mdb@cisco.com> and the rest of the Gurus at CISCO. */
-#ifndef __USE_MISC // glib sets this
+
+/* Turned it into an autoconf check, because GNU is not the only thing which
+ can provide timegm. -- 2002-09-22, Joel Baker */
+
+#ifndef HAVE_TIMEGM // Now with autoconf!
static time_t timegm(struct tm *t)
{
time_t tl, tb;
/* The number of bytes in a unsigned short. */
#undef SIZEOF_SHORT
+/* Define if we have the timegm() function */
+#undef HAVE_TIMEGM
+
/* These two are used by the statvfs shim for glibc2.0 and bsd */
/* Define if we have sys/vfs.h */
#undef HAVE_VFS_H
# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
HAVE_STATVFS = @HAVE_STATVFS@
+HAVE_TIMEGM = @HAVE_TIMEGM@
NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
# Shared library things
])
fi
+dnl We should use the real timegm function if we have it.
+AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM))
+AC_SUBST(HAVE_TIMEGM)
+
dnl Check the sizes etc. of the architecture
dnl This is stupid, it should just use the AC macros like it does below
dnl Cross compilers can either get a real C library or preload the cache
* Change verbose logging output of apt-ftparchive to go to stderr,
instead of stdout. Also, errors that occur no longer go to stdout,
but stderr. Closes: #161592
+ * Test for timegm in configure. Closes: #165516.
-- Jason Gunthorpe <jgg@debian.org> Sun, 15 Sep 2002 17:16:59 -0600