emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.50 compile problem on Windows XP


From: Eli Zaretskii
Subject: Re: 23.0.50 compile problem on Windows XP
Date: Fri, 05 Oct 2007 11:31:34 +0200

> Date: Thu, 04 Oct 2007 23:11:56 +0100
> From: Jason Rumney <address@hidden>
> Cc: address@hidden
> 
> There are several other files that include stdlib.h after lisp.h
> conditional on WINDOWSNT too. Does that not also cause the same problem?
> Also msdos.c includes lisp.h before stdlib.h, so there could be a
> problem there too.

No, msdos.c doesn't suffer from this problem, and I think I know why.
You will see in src/config.in that if HAVE_STDLIB_H is defined,
config.h will include stdlib.h.  Since we always include config.h
before any other headers, if some source file includes stdlib.h
explicitly, that second inclusion is effectively ignored (due to
idempotency of system headers), and the fact that meanwhile lisp.h
defined `abs' as a macro does not have any adverse effects.

However, the Windows build uses its own config.h that is produced from
nt/config.nt, not from src/config.in.  And config.nt does NOT include
stdlib.h.  Which is why I think the Windows build is the only one
affected by the macro `abs' in lisp.h, since even the MSDOS build
produces config.h from config.in (by editing it with Sed scripts in
the msdos/ subdirectory).

I still think that we should avoid a macro with a name that's
identical to a standard function.  We should rename it to something
that cannot clash with the standard C library.




reply via email to

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