This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for cygwin/mingw: Clean up subtarget switches and masks
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Mar 2002 08:59:38 +1100 (EST)
- Subject: PATCH for cygwin/mingw: Clean up subtarget switches and masks
The TARGET_DLL, TARGET_WIN32, TARGET_CYGWIN and TARGET_WINDOWS
defines in config/i386/cygwin.h are used only in that file and are
unnecessary. The switches for these defines do everything within cygwin.h
itself, by modifying specs. The only other references to these defines in
gcc src are in the Nov 1998 ChangeLog entry that added them and in the
unmaintained config/i386/win32.h target file. Removing them frees up the
associated bit masks. This allows the use of a unique bit for
MASK_NOP_FUN_DLLIMPORT, replacing the one that is currently shared with
MASK_SSE_SET in i386.h
Bootstrapped on i586-pc-mingw32 in 3.1 branch (C,C++,F,ObjC,Ada) and on
trunk (C,C++,F), with no new regressions.
ChangeLog
2002-03-25 Danny Smith <dannysmith@sourceforge.users.net>
* config/i386/cygwin.h (TARGET_DLL, TARGET_WIN32,
TARGET_CYGWIN, TARGET_WINDOWS): Remove unused switch defines.
(MASK_DLL, MASK_WIN32, MASK_CYGWIN, MASK_WINDOWS):
Remove unnecessary masks.
(MASK_NOP_FUN_DLLIMPORT): Use an unused bit.
(SUBTARGET_SWITCHES): Use empty masks for -mwin32, -mcygwin,
-mwindows, -mdll switches and their negations.
Index: cygwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/cygwin.h,v
retrieving revision 1.64
diff -u -p -r1.64 cygwin.h
--- cygwin.h 2002/03/21 00:23:36 1.64
+++ cygwin.h 2002/03/25 21:41:19
@@ -32,36 +32,25 @@ Boston, MA 02111-1307, USA. */
#include "i386/gas.h"
#include "dbxcoff.h"
-/* Augment TARGET_SWITCHES with the cygwin/no-cygwin options. */
-#define MASK_WIN32 0x40000000 /* Use -lming32 interface */
-#define MASK_CYGWIN 0x20000000 /* Use -lcygwin interface */
-#define MASK_WINDOWS 0x10000000 /* Use windows interface */
-#define MASK_DLL 0x08000000 /* Use dll interface */
-#define MASK_NOP_FUN_DLLIMPORT 0x20000 /* Ignore dllimport for functions
*/
+/* Masks for subtarget switches used by other files. */
+#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for
functions */
-#define TARGET_WIN32 (target_flags & MASK_WIN32)
-#define TARGET_CYGWIN (target_flags & MASK_CYGWIN)
-#define TARGET_WINDOWS (target_flags & MASK_WINDOWS)
-#define TARGET_DLL (target_flags & MASK_DLL)
+/* Used in winnt.c. */
#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT)
#undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES \
-{ "cygwin", MASK_CYGWIN, \
- N_("Use the Cygwin interface") }, \
-{ "no-cygwin", MASK_WIN32, \
- N_("Use the Mingw32 interface") }, \
-{ "windows", MASK_WINDOWS, N_("Create GUI application") }, \
-{ "no-win32", -MASK_WIN32, N_("Don't set Windows defines") },\
-{ "win32", 0, N_("Set Windows defines") }, \
-{ "console", -MASK_WINDOWS, \
- N_("Create console application") }, \
-{ "dll", MASK_DLL, N_("Generate code for a DLL") }, \
-{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, \
- N_("Ignore dllimport for functions") }, \
-{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
+{ "cygwin", 0, N_("Use the Cygwin interface") }, \
+{ "no-cygwin", 0, N_("Use the Mingw32 interface") }, \
+{ "windows", 0, N_("Create GUI application") }, \
+{ "no-win32", 0, N_("Don't set Windows defines") }, \
+{ "win32", 0, N_("Set Windows defines") }, \
+{ "console", 0, N_("Create console application") },\
+{ "dll", 0, N_("Generate code for a DLL") }, \
+{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, \
+ N_("Ignore dllimport for functions") }, \
+{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
{ "threads", 0, N_("Use Mingw-specific thread support") },
-
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D_X86_=1 -Asystem=winnt"
http://www.sold.com.au - SOLD.com.au Auctions
- 1,000s of Bargains!