From c244723ece5585ae4f828181631c46a017367f08 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Sun, 29 Jul 2018 22:14:18 +0100 Subject: [PATCH] Don't restrict exposure when including --- w32api/ChangeLog | 8 +++++ w32api/include/winerror.h | 81 ++++++++--------------------------------------- 2 files changed, 21 insertions(+), 68 deletions(-) diff --git a/w32api/ChangeLog b/w32api/ChangeLog index d8c6e14..51da6c2 100644 --- a/w32api/ChangeLog +++ b/w32api/ChangeLog @@ -1,3 +1,11 @@ +2018-07-29 Keith Marshall + + Don't restrict exposure when including + + * include/winerror.h [__WINSOCK_H_SOURCED__]: Remove filters. + (__WINSOCK_V1_ERRORS__, __WINSOCK_V2_ERRORS__): Do not define; delete + all dependent filter references. + 2018-07-11 Keith Marshall Make header effectively self-contained. diff --git a/w32api/include/winerror.h b/w32api/include/winerror.h index a059df1..aed1c52 100644 --- a/w32api/include/winerror.h +++ b/w32api/include/winerror.h @@ -6,7 +6,7 @@ * $Id$ * * Written by Anders Norlander - * Copyright (C) 1998, 2000-2006, 2008, 2009, 2012, 2016, 2017, + * Copyright (C) 1998, 2000-2006, 2008, 2009, 2012, 2016-2018, * MinGW.org Project * * @@ -32,12 +32,6 @@ */ #ifndef _WINERROR_H #pragma GCC system_header - -#ifndef __WINSOCK_H_SOURCED__ -/* Part of this header is available for selective inclusion by ; - * mark it as fully processed, only when NOT so included; otherwise, occlude - * those parts which are not relevant for - */ #define _WINERROR_H #define _HRESULT_TYPEDEF_(_sc) ((HRESULT)(_sc)) @@ -1598,31 +1592,12 @@ #define DNS_ERROR_DP_ALREADY_ENLISTED 9904L #define DNS_ERROR_DP_NOT_AVAILABLE 9905L -/* This ends the first group of error codes which are to be occluded - * when selectively included by - */ -#endif /* !__WINSOCK_H_SOURCED__ */ - -/* The following are to be defined both when including directly, - * and when including it selectively, via ; (those codes which are - * specific to WinSock v2 are excluded, during selective inclusion, unless - * itself is included on behalf of ). - */ -#undef __WINSOCK_V1_ERRORS__ -#if ! (defined _WINERROR_H && defined _WINSOCK_H) -/* Error codes for WinSock v1 must be defined if either _WINERROR_H is - * defined, (indicating direct inclusion of ), or _WINSOCK_H - * is defined, (indicating possible indirect inclusion via ), - * but if both are defined, this must be the second pass through these - * definitions; there is no need to process them a second time. - */ -# define __WINSOCK_V1_ERRORS__ (defined _WINERROR_H || defined _WINSOCK_H) -#endif - -#if __WINSOCK_V1_ERRORS__ -/* The following group of error codes are applicable to both WinSock v1, - * and WinSock v2 protocols, and we have yet to define them; do so now, - * noting that all are biased by addition of WSABASEERR. +/* The following group of error codes are specific to WinSock programming, + * and are applicable to both WinSock v1, and WinSock v2 protocols. At one + * time these definitions were duplicated (inconsistently) in , + * and in the WinSock specific headers, but since those headers ultimately + * include anyway, that duplication makes no sense; thus, + * is now the sole provider of these definitions. */ #define __WSA_ERRNO(N) (WSABASEERR + (N)) #define WSABASEERR 10000L @@ -1674,24 +1649,10 @@ #define WSAVERNOTSUPPORTED __WSA_ERRNO( 92 ) /* 10092L */ #define WSANOTINITIALISED __WSA_ERRNO( 93 ) /* 10093L */ #define WSAEDISCON __WSA_ERRNO( 101 ) /* 10101L */ -#endif /* __WINSOCK_V1_ERRORS__ */ - -#undef __WINSOCK_V2_ERRORS__ -#if ! (defined _WINERROR_H && defined _WINSOCK2_H) -/* Error codes for WinSock v2 must be defined if either _WINERROR_H is - * defined, (indicating direct inclusion of ), or _WINSOCK2_H - * is defined, (indicating possible indirect inclusion via on - * behalf of ), but if both are defined, it is implicit that - * this must be the second pass through these definitions; there is no - * need to process them a second time. - */ -# define __WINSOCK_V2_ERRORS__ (defined _WINERROR_H || defined _WINSOCK2_H) -#endif -#if __WINSOCK_V2_ERRORS__ -/* The following group of error codes are specific to the WinSock v2 protocol; - * their definitions are suppressed during selective inclusion by , - * when such inclusion has not been requested by +/* The following group of error codes are specific to the WinSock v2 protocol. + * Once again, these were originally duplicated in ; + * is now the sole provider of these definitions. */ #define WSAENOMORE __WSA_ERRNO( 102 ) /* 10102L */ #define WSAECANCELLED __WSA_ERRNO( 103 ) /* 10103L */ @@ -1704,9 +1665,7 @@ #define WSA_E_NO_MORE __WSA_ERRNO( 110 ) /* 10110L */ #define WSA_E_CANCELLED __WSA_ERRNO( 111 ) /* 10111L */ #define WSAEREFUSED __WSA_ERRNO( 112 ) /* 10112L */ -#endif /* __WINSOCK_V2_ERRORS__ */ -#if __WINSOCK_V1_ERRORS__ /* A further group of error codes which apply to both WinSock v1, and WinSock v2 * protocols; collated here to preserve numerical sort order across both groups. */ @@ -1714,12 +1673,9 @@ #define WSATRY_AGAIN __WSA_ERRNO( 1002 ) /* 11002L */ #define WSANO_RECOVERY __WSA_ERRNO( 1003 ) /* 11003L */ #define WSANO_DATA __WSA_ERRNO( 1004 ) /* 11004L */ -#endif /* __WINSOCK_V1_ERRORS__ */ -#if __WINSOCK_V2_ERRORS__ -/* WinSock v2 Quality of Service errors; once again, these definitions are - * suppressed during selective inclusion by , unless inclusion is - * on behalf of +/* WinSock v2 Quality of Service errors; once again, formerly duplicated in + * , but now provided exclusively by */ #define WSA_QOS_RECEIVERS __WSA_ERRNO( 1005 ) /* 11005L */ #define WSA_QOS_SENDERS __WSA_ERRNO( 1006 ) /* 11006L */ @@ -1748,18 +1704,8 @@ #define WSA_QOS_ESDMODEOBJ __WSA_ERRNO( 1029 ) /* 11029L */ #define WSA_QOS_ESHAPERATEOBJ __WSA_ERRNO( 1030 ) /* 11030L */ #define WSA_QOS_RESERVED_PETYPE __WSA_ERRNO( 1031 ) /* 11031L */ -#endif /* __WINSOCK_V2_ERRORS__ */ - -/* Regardless of which groups, if any, of WinSock error codes may have been - * defined on this occasion, we no longer require their selectors; clean up - * the namespace. - */ -#undef __WINSOCK_V1_ERRORS__ -#undef __WINSOCK_V2_ERRORS__ -#ifdef _WINERROR_H -/* The remaining error codes defined below are to be exposed ONLY when - * is included directly, in its own right. +/* The remaining error codes, defined below, are general purpose. */ #define ERROR_IPSEC_QM_POLICY_EXISTS 13000L #define ERROR_IPSEC_QM_POLICY_NOT_FOUND 13001L @@ -2406,6 +2352,5 @@ #define NTE_TOKEN_KEYSET_STORAGE_FULL ((HRESULT)(0x80090023L)) #define NTE_TEMPORARY_PROFILE ((HRESULT)(0x80090024L)) #define NTE_FIXEDPARAMETER ((HRESULT)(0x80090025L)) -#endif /* _WINERROR_H */ #endif /* !_WINERROR_H: $RCSfile$: end of file */ -- 2.11.0