[winpr,include] fix reserved-identifier warnings

* Remove symbols where possible
* Use #pragma where the symbols are implementing ISO or windows
  functions
This commit is contained in:
akallabeth 2024-09-13 14:29:26 +02:00
parent 7ef9345743
commit d2641ea55f
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
9 changed files with 52 additions and 13 deletions

View File

@ -30,6 +30,9 @@
#include <winpr/spec.h>
#include <winpr/string.h>
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifndef _WIN32
#include <unistd.h>
@ -237,4 +240,6 @@ extern "C"
#define winpr_aligned_calloc(count, size, alignment) _aligned_recalloc(NULL, count, size, alignment)
#endif /* defined(_WIN32) && (!defined(__MINGW32__) || defined(_UCRT)) */
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_CRT_H */

View File

@ -24,6 +24,9 @@
#include <winpr/wtypes.h>
#include <winpr/handle.h>
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifdef _WIN32
#include <winioctl.h>
@ -253,4 +256,6 @@ extern "C"
#define ACCESS_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 14) & 0x3))
#define FUNCTION_FROM_CTL_CODE(ctrlCode) ((DWORD)((ctrlCode >> 2) & 0xFFF))
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_IO_H */

View File

@ -27,7 +27,7 @@
#include <winpr/wtypes.h>
typedef enum _KERB_LOGON_SUBMIT_TYPE
typedef enum
{
KerbInvalidValue = 0, /** @since version 3.9.0 */
KerbInteractiveLogon = 2,
@ -46,7 +46,7 @@ typedef enum _KERB_LOGON_SUBMIT_TYPE
} KERB_LOGON_SUBMIT_TYPE,
*PKERB_LOGON_SUBMIT_TYPE;
typedef struct _KERB_TICKET_LOGON
typedef struct
{
KERB_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags;
@ -60,7 +60,7 @@ typedef struct _KERB_TICKET_LOGON
#define MSV1_0_OWF_PASSWORD_LENGTH 16
typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL
typedef struct
{
ULONG Version;
ULONG Flags;

View File

@ -22,6 +22,10 @@
#include <winpr/platform.h>
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifdef _WIN32
#include <specstrings.h>
@ -31,9 +35,6 @@
#else
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME1 u1
#define DUMMYUNIONNAME2 u2
@ -957,10 +958,6 @@ extern "C++"
#define CONTAINING_RECORD(address, type, field) \
((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field)))
#if defined(__clang__)
WINPR_PRAGMA_DIAG_POP
#endif
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
@ -983,4 +980,6 @@ WINPR_PRAGMA_DIAG_POP
#endif
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_SPEC_H */

View File

@ -504,7 +504,7 @@ typedef struct
#define PSecPkgCredentials_SSIProvider PSecPkgCredentials_SSIProviderA
#endif
typedef struct _SecPkgCredentials_Cert
typedef struct
{
unsigned long EncodedCertSize;
unsigned char* EncodedCert;
@ -752,7 +752,7 @@ typedef struct
#ifndef SEC_WINNT_AUTH_IDENTITY_VERSION_2
#define SEC_WINNT_AUTH_IDENTITY_VERSION_2 0x201
typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2
typedef struct
{
UINT32 Version;
UINT16 cbHeaderLength;
@ -775,7 +775,7 @@ typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2
// https://docs.microsoft.com/en-us/windows/win32/api/sspi/ns-sspi-sec_winnt_auth_identity_info
typedef union _SEC_WINNT_AUTH_IDENTITY_INFO
typedef union
{
SEC_WINNT_AUTH_IDENTITY_EXW AuthIdExw;
SEC_WINNT_AUTH_IDENTITY_EXA AuthIdExa;

View File

@ -28,6 +28,9 @@
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifdef __cplusplus
extern "C"
{
@ -431,4 +434,6 @@ extern "C"
}
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_CRT_STRING_H */

View File

@ -178,7 +178,13 @@ extern "C"
DECLSPEC_NORETURN WINPR_API VOID ExitProcess(UINT uExitCode);
WINPR_API BOOL GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode);
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
WINPR_API HANDLE _GetCurrentProcess(void);
WINPR_PRAGMA_DIAG_POP
WINPR_API DWORD GetCurrentProcessId(void);
WINPR_API BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode);
@ -238,7 +244,11 @@ extern "C"
WINPR_API VOID ExitThread(DWORD dwExitCode);
WINPR_API BOOL GetExitCodeThread(HANDLE hThread, LPDWORD lpExitCode);
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
WINPR_API HANDLE _GetCurrentThread(void);
WINPR_PRAGMA_DIAG_POP
WINPR_API DWORD GetCurrentThreadId(void);
typedef void (*PAPCFUNC)(ULONG_PTR Parameter);
@ -268,9 +278,14 @@ extern "C"
/*
* GetCurrentProcess / GetCurrentThread cause a conflict on Mac OS X
*/
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#define _GetCurrentProcess GetCurrentProcess
#define _GetCurrentThread GetCurrentThread
WINPR_PRAGMA_DIAG_POP
#endif
/* CommandLineToArgvA is not present in the original Windows API, WinPR always exports it */

View File

@ -25,6 +25,9 @@
#include <winpr/wtypes.h>
#include <winpr/windows.h>
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifdef _WIN32
#define _accept accept
@ -365,4 +368,6 @@ extern "C"
#endif /* _WIN32 */
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_WINSOCK_H */

View File

@ -29,6 +29,9 @@
#define CHANNEL_CHUNK_MAX_LENGTH 16256
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
#ifdef _WIN32
#define CurrentTime _CurrentTime /* Workaround for X11 "CurrentTime" header conflict */
@ -1515,4 +1518,6 @@ extern "C"
}
#endif
WINPR_PRAGMA_DIAG_POP
#endif /* WINPR_WTSAPI_H */