]> git.eshelyaron.com Git - emacs.git/commit
Limit <config.h>’s includes
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Sep 2016 19:14:04 +0000 (12:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Sep 2016 19:38:52 +0000 (12:38 -0700)
commitf4eb8900295d75c4afec256f75aea22494376fde
tree70203645e9b0b603ef8dbca6c50c01795a081512
parentd1890a3a4a18f79cabf4caf8d194cdc29ea4bf05
Limit <config.h>’s includes

This follows up on recent problems with the fact that config.h
includes stdlib.h etc.; some files need to include stdlib.h later.
config.h generally should limit itself to includes that are
universally safe; outside of MS-Windows, only stdbool.h makes
the cut among the files currently included.  So, move the
other includes to just the files that need them (Bug#24506).
* configure.ac (config_opsysfile): Remove, as this generic hook
is no longer needed.
* lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
* src/w32proc.c (_GNU_SOURCE):
Remove, as it’s OK for config.h to do this now.
* src/conf_post.h: Include <ms-w32.h>, instead of the generic
config_opsysfile, for simplicity as this old way of configuring is
now done only for the MS-Windows port.  Do not include <ms-w32.h>
if DEFER_MS_W32_H, for the benefit of the few files that want its
effects later.  Do not include <alloca.h>, <string.h>, or
<stdlib.h>.  Other files modified to include these headers as
needed, or to not include headers that are no longer needed.
* src/lisp.h: Include <alloca.h> and <string.h> here, since
some of the inline functions need them.
* src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
we can rely on SAFE_ALLOCA.)  There is no longer any need to
worry about HAVE_ALLOCA_H.
* src/unexmacosx.c: Rely on config.h not including stdlib.h.
* src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
Define before including <config.h> first, and include <ms-w32.h>
after the troublesome headers.
49 files changed:
configure.ac
lib-src/emacsclient.c
lib-src/etags.c
lib-src/hexl.c
lib-src/make-docfile.c
lib-src/movemail.c
lib-src/pop.c
lib-src/profile.c
lib-src/update-game-score.c
lib/openat-die.c
lwlib/lwlib-Xm.c
lwlib/lwlib.c
src/alloc.c
src/buffer.c
src/callproc.c
src/charset.c
src/conf_post.h
src/dbusbind.c
src/dispnew.c
src/doprnt.c
src/editfns.c
src/emacs-module.c
src/emacs.c
src/eval.c
src/filelock.c
src/fns.c
src/font.c
src/fontset.c
src/frame.c
src/keymap.c
src/lisp.h
src/lread.c
src/process.c
src/regex.c
src/sysdep.c
src/systty.h
src/term.c
src/unexcw.c
src/unexmacosx.c
src/w32.c
src/w32notify.c
src/w32proc.c
src/widget.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xfont.c
src/xgselect.c
src/xterm.c