Subject: CVS domivogt: * Added detection for time.h vs sys/time.h headers.

From: FVWM CVS <[email-masked]>
Date: Mon, 05 Aug 2002 11:36:37 -0500

CVSROOT:	/home/cvs/fvwm
Module name:	fvwm
Changes by:	domivogt	02/08/05 11:36:37

Modified files:
	.              : ChangeLog configure.in 
	docs           : DEVELOPERS 
	fvwm           : events.c ewmh_intern.h misc.c 
	                 module_interface.c stack.c 
	libs           : Makefile.am Picture.c fvwmsignal.h usleep.c 
	modules        : ChangeLog 
	modules/FvwmAnimate: FvwmAnimate.c 
	modules/FvwmAuto: FvwmAuto.c 
	modules/FvwmBanner: FvwmBanner.c 
	modules/FvwmButtons: FvwmButtons.c 
	modules/FvwmCommand: FvwmCommand.h 
	modules/FvwmConsole: FvwmConsole.h 
	modules/FvwmCpp: FvwmCpp.c 
	modules/FvwmDebug: FvwmDebug.c 
	modules/FvwmDragWell: fvwmDragWell.c 
	modules/FvwmEvent: FvwmEvent.c 
	modules/FvwmForm: FvwmForm.c 
	modules/FvwmIconBox: FvwmIconBox.c 
	modules/FvwmIconMan: FvwmIconMan.h 
	modules/FvwmIdent: FvwmIdent.c 
	modules/FvwmM4 : FvwmM4.c 
	modules/FvwmPager: FvwmPager.c 
	modules/FvwmRearrange: FvwmRearrange.c 
	modules/FvwmSave: FvwmSave.c 
	modules/FvwmSaveDesk: FvwmSaveDesk.c 
	modules/FvwmScript: Instructions.c types.h 
	modules/FvwmScript/Widgets: PopupMenu.c 
	modules/FvwmScroll: GrabWindow.c 
	modules/FvwmTaskBar: FvwmTaskBar.c Goodies.c 
	modules/FvwmWharf: FvwmWharf.c 
	modules/FvwmWharf/ASSound: ASSound.c 
	modules/FvwmWinList: FvwmWinList.c 
	vms            : vms.c vms.h 
Added files:
	libs           : ftime.h 

Log message:
* Added detection for time.h vs sys/time.h headers.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 6 Aug 2002 22:01:56 +0000

> * Added detection for time.h vs sys/time.h headers.

I am not sure why you did this. With my glibc-2.2.5, time.h and
sys/time.h are two different things although sys/time.h includes some
portion of time.h, but not all.

So after this commit modules/FvwmTaskBar/Goodies,c fails to compile and
modules/FvwmWharf/FvwmWharf.c produces a warning (implicit declaration of
function `time'). Adding #include <time.h> in both solves the problem.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 7 Aug 2002 01:26:21 +0200

On Tue, Aug 06, 2002 at 10:01:56PM +0000, Mikhael Goikhman wrote:
> I am not sure why you did this.

For several reasons.  First, inclusion of sys/time.h was not
properly protected with "#ifdef HAVE_SYS_TIME_H".  The autoconf
documentation doesn't explicitly state that this is necessary, but
if it's not I wonder why it's mentioned at all.  Second, the
autoconf info page states:

 - Macro: AC_HEADER_TIME
     If a program may include both `time.h' and `sys/time.h', define
     `TIME_WITH_SYS_TIME'.  On some older systems, `sys/time.h'
     includes `time.h', but `time.h' is not protected against multiple
     inclusion, so programs should not explicitly include both files.

Some of our source files did include both, time.h and sys/time.h.
Third, I wanted to remove the need to remember this necessities by
moving the #includes for both headers into a new header ftime.h
that encapsulates the necessary logic.  For those files that just
included time.h, including ftime.h may do more than necessary but
also including sys/time.h.

Apart from that, your problem is simply a bug in the configure.in
script.  I forgot to call AC_CHECK_HEADERS(sys/time.h), so
sys/time.h gets never included on some systems.

> With my glibc-2.2.5, time.h and

> function `time'). Adding #include <time.h> in both solves the problem.

Hm, that's funny.  I'd have expected that with the bug in
configure.in only time.h would have been included, not sys/time.h.
Is it possible that the order in which the files are included is
important?  And which autoconf version do you have?  What messages
about the time headers do you get in configure?

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 7 Aug 2002 01:21:48 +0000

> sys/time.h gets never included on some systems.

I think this is not the case here. HAVE_SYS_TIME_H was defined even
without an explicit check for sys/time.h.

> about the time headers do you get in configure?

I am trying to move fvwm to autoconf-2.53, still not fully successful,
so autoheader (and some other things) do not work for me.

I downgraded to autoconf-2.13 (the only relable autoconf version for now)
and this time.h problems disappeared. I know why it is. TIME_WITH_SYS_TIME
is now defined, but it was not defined before you uncommented
AC_HEADER_TIME and my config.h can't be regenerated with autoconf-2.53.

At least I learned where this TIME_WITH_SYS_TIME gets defined.
I returned to autoconf-2.53 and will try to defeat it soon.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 7 Aug 2002 10:50:30 +0200

> without an explicit check for sys/time.h.

Yes, I noticed that too after I sent the mail.  The "select" check
implicitly sets it.

> I returned to autoconf-2.53 and will try to defeat it soon.

There is some documentation on 2.13 vs. 2.53 in the autoconf info
page (Node "Obsolete Constructs::Autoconf 2.13").  I'm currently
writing or rewriting a couple of autoconf/automake setups at work
with 2.53.  Maybe we should make the move to the new version soon.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]