From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Preprocessor defines in MS-Windows build Date: Sat, 07 Jun 2008 20:30:18 +0300 Message-ID: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1212859880 24093 80.91.229.12 (7 Jun 2008 17:31:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Jun 2008 17:31:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 07 19:32:02 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K52Gn-0006mq-RH for ged-emacs-devel@m.gmane.org; Sat, 07 Jun 2008 19:32:02 +0200 Original-Received: from localhost ([127.0.0.1]:56101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K52G0-0008Bd-S9 for ged-emacs-devel@m.gmane.org; Sat, 07 Jun 2008 13:31:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K52Fw-0008BC-T1 for emacs-devel@gnu.org; Sat, 07 Jun 2008 13:31:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K52Fv-0008Az-Bf for emacs-devel@gnu.org; Sat, 07 Jun 2008 13:31:07 -0400 Original-Received: from [199.232.76.173] (port=45940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K52Fv-0008As-2F for emacs-devel@gnu.org; Sat, 07 Jun 2008 13:31:07 -0400 Original-Received: from mtaout7.012.net.il ([84.95.2.19]:43065) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K52Fu-0002fc-SK for emacs-devel@gnu.org; Sat, 07 Jun 2008 13:31:07 -0400 Original-Received: from HOME-C4E4A596F7 ([80.230.28.131]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K23009GZRUOVUD0@i-mtaout7.012.net.il> for emacs-devel@gnu.org; Sat, 07 Jun 2008 20:13:36 +0300 (IDT) X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 10 (1203?) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:98596 Archived-At: 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?