gettimeofday: fix C++ crosscompilation
authorJohn W. Eaton <jwe@gnu.org>
Tue, 17 Dec 2013 19:04:37 +0000 (11:04 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 17 Dec 2013 19:05:13 +0000 (11:05 -0800)
commit24846718507fe1565d64742a0a8c68acb680c640
treed069a29937a0c0c7dbed3f891484bd27a3b1a24e
parente7086a9a301ffcfef17edbcba9e7c0312c33f7a8
gettimeofday: fix C++ crosscompilation

Never replace gmtime and localtime by macros when compiling with
C++, this prevents <ctime> from being included.

* m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Do not
define gmtime and localtime as preprocessor macros.  Instead
define some HAVE_GMTIME, HAVE_LOCALTIME, REPLACE_GMTIME, and
REPLACE_LOCALTIME substitutions.
* lib/time.in.h: Declare gmtime and localtime when needed.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): AC_SUBST HAVE_GMTIME,
HAVE_LOCALTIME, REPLACE_GMTIME, and REPLACE_LOCALTIME.
* modules/time: Depend on gettimeofday, and substitute the above
variables in time.h.
ChangeLog
lib/time.in.h
m4/gettimeofday.m4
m4/time_h.m4
modules/time