[Top][All Lists]

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

Re: gnulib problem with mktime & ctime interaction

From: Jim Meyering
Subject: Re: gnulib problem with mktime & ctime interaction
Date: Tue, 28 Jul 2009 10:40:10 +0200

Bruno Haible wrote:
> Thanks. Even more minimally:
>   $ ./gnulib-tool --create-testdir --dir=/tmp/testdir mktime
>   $ cat > foo.cc <<EOF
>   #include <config.h>
>   #include <ctime>
>   EOF
>   $ (cd /tmp/testdir && ac_cv_func_working_mktime=no ./configure && make)
>   $ gcc -I/tmp/testdir -I/tmp/testdir/gllib -c foo.cc
>   In file included from foo.cc:2:
>   /usr/include/c++/4.3/ctime:73: error: ‘::mktime’ has not been declared
> Jim, here is a proposed fix. I verified that it fixes the problem. The
> advantage of the newer idiom, compared to the old idiom that defined the
> replacements in config.h, is that the declaration of the non-rpl function
> (from the system header file) is preserved. OK to commit?
> 2009-07-27  Bruno Haible  <address@hidden>
>       Fix compilation error when <ctime> is used and mktime is replaced.
>       * lib/time.in.h (mktime): New declaration.
>       * m4/mktime.m4 (gl_FUNC_MKTIME): Require gl_HEADER_TIME_H_DEFAULTS. Set
>       REPLACE_MKTIME instead of defining mktime in config.h.
>       * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize REPLACE_MKTIME.
>       * modules/time (Makefile.am): Substitute REPLACE_MKTIME.
>       Reported by Ross McFarland <address@hidden>.

Hi Bruno,
Thanks for dealing with that.
Your fix seems fine, though I don't see any value
in retaining the original declaration.

You're welcome to push it.

reply via email to

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