all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Preprocessor defines in MS-Windows build
@ 2008-06-07 17:30 Eli Zaretskii
  2008-06-07 19:04 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eli Zaretskii @ 2008-06-07 17:30 UTC (permalink / raw)
  To: emacs-devel

Here's an example of a typical compilation command line on Windows:

  gcc -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 -D_X86_=1 -c -gstabs+ -g3  -mtune=pentium4 -O2  -Di386 -D_CRTAPI1=_cdecl   -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I../nt/inc -D_UCHAR_T -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1  -o oo-spd/i386/dispnew.o dispnew.c

This uses a lot -f -DSOMETHING switches, and it looks like most of
these are not needed, and almost all the rest can be put on
src/s/ms-w32.h.  Can someone help understanding the purpose of each
switch?

Below I summarize what I gleaned from grepping fo each symbol in the
Emacs sources and in the system headers:

 WIN32_LEAN_AND_MEAN -- needed to produce a leaner executable
 _WIN32_WINNT        -- needed to prevent accidental use of features
                        unavailable on older Windows versions we still
                        support
 _X86_               -- not needed, defined automatically by MinGW
                        headers
 i386                -- not needed
 _CRTAPI1            -- used only in sysdep.c, can be replaced by a
                        literal _cdecl
 WINDOWSNT           -- needed for W32-specific code in Emacs
 DOS_NT              -- needed for code that is specific to both DOS
                        and W32 ports
 _UCHAR_T            -- not needed
 HAVE_NTGUI          -- can be replaced with WINDOWSNT, since the W32
                        build doesn't use any other GUI
 USE_CRT_DLL         -- looks like it's unneeded, since we never use
                        anything but the CRTDLL.dll runtime

(I've omitted the -DHAVE_CONFIG_H and -Demacs, which are common to all
platforms.)

Does someone know anything that contradicts the above?  If not, I
think we should remove those defines that are not needed anymore, and
put those which are needed in ms-w32.h.

Comments?





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-06-27  8:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-07 17:30 Preprocessor defines in MS-Windows build Eli Zaretskii
2008-06-07 19:04 ` Stefan Monnier
2008-06-07 20:25   ` Eli Zaretskii
2008-06-08  3:09     ` Stefan Monnier
2008-06-07 21:57 ` Jason Rumney
2008-06-07 23:53   ` Óscar Fuentes
2008-06-08  6:36     ` Eli Zaretskii
2008-06-09  1:55       ` David Robinow
2008-06-09  8:42         ` Eli Zaretskii
2008-06-26 22:47 ` Juanma Barranquero
2008-06-27  8:59   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.