Throughout, drop unnecessary explicit includes of windows header files

included by default.
	* winlean.h: Add long comment to explain why we have to define certain
	symbols.
	(_NORMALIZE_): Define.
	(_WINNLS_): Drop definition and subsequent undef.
	(_WINNETWK_): Ditto.
	(_WINSVC_): Ditto.

2013-11-23  Eric Blake  <eblake@redhat.com>
This commit is contained in:
Corinna Vinschen 2013-11-24 12:13:36 +00:00
parent 6958a5e8f1
commit d2a88d9792
21 changed files with 23 additions and 49 deletions

View File

@ -1,3 +1,14 @@
2013-11-24 Corinna Vinschen <corinna@vinschen.de>
Throughout, drop unnecessary explicit includes of windows header files
included by default.
* winlean.h: Add long comment to explain why we have to define certain
symbols.
(_NORMALIZE_): Define.
(_WINNLS_): Drop definition and subsequent undef.
(_WINNETWK_): Ditto.
(_WINSVC_): Ditto.
2013-11-23 Eric Blake <eblake@redhat.com>
dup2: fix off-by-one crash

View File

@ -1,6 +1,7 @@
/* assert.cc: Handle the assert macro for WIN32.
Copyright 1997, 1998, 2000, 2001, 2002, 2007, 2008, 2009, 2011 Red Hat, Inc.
Copyright 1997, 1998, 2000, 2001, 2002, 2007, 2008, 2009, 2011, 2013
Red Hat, Inc.
This file is part of Cygwin.
@ -9,8 +10,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include <wingdi.h>
#include <winuser.h>
#include <assert.h>
#include <stdlib.h>

View File

@ -16,7 +16,6 @@ details. */
#include <locale.h>
#include <assert.h>
#include <cygwin/version.h>
#include <winnls.h>
#include "pinfo.h"
#include "perprocess.h"
#include "path.h"

View File

@ -12,8 +12,6 @@ details. */
#define CYGTLS_HANDLE
#include "winsup.h"
#include "miscfuncs.h"
#include <wingdi.h>
#include <winuser.h>
#include <imagehlp.h>
#include <stdlib.h>
#include <syslog.h>

View File

@ -13,8 +13,6 @@ details. */
#include "winsup.h"
#include <wchar.h>
#include <wingdi.h>
#include <winuser.h>
#include "cygerrno.h"
#include "path.h"
#include "fhandler.h"

View File

@ -14,9 +14,6 @@ details. */
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnls.h>
#include <ctype.h>
#include <sys/param.h>
#include <sys/cygwin.h>

View File

@ -17,7 +17,6 @@ details. */
#include "dtable.h"
#include "cygheap.h"
#include "cygthread.h"
#include <winnetwk.h>
#include <dirent.h>

View File

@ -13,8 +13,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include <wingdi.h>
#include <winuser.h>
#include "cygerrno.h"
#include "path.h"
#include "fhandler.h"

View File

@ -17,9 +17,6 @@ details. */
#include <limits.h>
#include <sys/param.h>
#include <wchar.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnls.h>
#include "cygtls.h"
#include "ntdll.h"
#include "path.h"

View File

@ -1,7 +1,7 @@
/* mount.cc: mount handling.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@ -14,10 +14,6 @@ details. */
#include <mntent.h>
#include <ctype.h>
#include <winioctl.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnetwk.h>
#include <shlobj.h>
#include <cygwin/version.h>
#include "cygerrno.h"
#include "security.h"

View File

@ -20,7 +20,6 @@ details. */
system functions on Vista and later. */
#define _INC_NETIOAPI
#include "winsup.h"
#include <winnls.h>
#include <ws2tcpip.h>
#include <mswsock.h>
#include <iphlpapi.h>

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include <winnls.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

View File

@ -52,10 +52,6 @@
#include "miscfuncs.h"
#include <ctype.h>
#include <winioctl.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnetwk.h>
#include <winnls.h>
#include <shlobj.h>
#include <sys/param.h>
#include <sys/cygwin.h>

View File

@ -19,8 +19,6 @@ details. */
#include <sys/param.h>
#include "ntdll.h"
#include <wingdi.h>
#include <winuser.h>
#define USE_SYS_TYPES_FD_SET
#include <winsock2.h>
#include <netdb.h>

View File

@ -26,8 +26,6 @@ details. */
#include "spinlock.h"
#include <alloca.h>
#include <wchar.h>
#include <wingdi.h>
#include <winuser.h>
shared_info NO_COPY *cygwin_shared;
user_info NO_COPY *user_shared;

View File

@ -14,8 +14,6 @@ details. */
#include <unistd.h>
#include <process.h>
#include <sys/wait.h>
#include <wingdi.h>
#include <winuser.h>
#include <wchar.h>
#include <ctype.h>
#include <sys/cygwin.h>

View File

@ -10,8 +10,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include <wingdi.h>
#include <winuser.h>
#include <ctype.h>
#include "cygerrno.h"
#include "pinfo.h"

View File

@ -1,7 +1,7 @@
/* strfuncs.cc: string functions
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@ -13,7 +13,6 @@ details. */
#include <stdlib.h>
#include <sys/param.h>
#include <wchar.h>
#include <winnls.h>
#include <ntdll.h>
#include "path.h"
#include "fhandler.h"

View File

@ -24,7 +24,6 @@ details. */
#define pwrite __FOO_pwrite
#include "winsup.h"
#include <winnls.h>
#include "miscfuncs.h"
#include <sys/stat.h>
#include <sys/vfs.h> /* needed for statfs */

View File

@ -13,8 +13,6 @@ details. */
#include "winsup.h"
#include <sys/time.h>
#include <wingdi.h>
#include <winuser.h>
#define USE_SYS_TYPES_FD_SET
#include <winsock2.h>
#include "perprocess.h"

View File

@ -12,14 +12,18 @@ details. */
#define _WINLEAN_H 1
#define WIN32_LEAN_AND_MEAN 1
/* Mingw64 */
#define _WINNLS_
#define _WINNETWK_
#define _WINSVC_
/* The following macros have to be defined, otherwise the autoload mechanism
in autoload.cc leads to "multiple definition" errors. The macros control
the declarations of symbols in the Mingw64 w32api headers. If they are
not defined, a DECLSPEC_IMPORT will be added to the symbol declarations.
This leads to a definition of the symbols in the sources using the
autoloaded symbols, which in turn clashes with the definition in the
w32api library exporting the symbols. */
#define _ADVAPI32_
#define _DSGETDCAPI_
#define _GDI32_
#define _KERNEL32_
#define _NORMALIZE_
#define _OLE32_
#define _SHELL32_
#define _SPOOL32_
@ -75,10 +79,6 @@ details. */
#undef CRITICAL
#endif
#undef _WINNLS_
#undef _WINNETWK_
#undef _WINSVC_
/* When Terminal Services are installed, the GetWindowsDirectory function
does not return the system installation dir, but a user specific directory
instead. That's not what we have in mind when calling GetWindowsDirectory