Fixed all reserved-id-macro warnings

This commit is contained in:
Armin Novak 2021-09-08 15:37:45 +02:00 committed by akallabeth
parent 210c56d0fb
commit 0fe1e2359e
30 changed files with 317 additions and 160 deletions

View File

@ -726,7 +726,7 @@ static UINT handle_platform_mounts_sun(hotplug_dev* dev_array, size_t* size)
{ {
FILE* f; FILE* f;
struct mnttab ent; struct mnttab ent;
f = fopen("/etc/mnttab", "r"); f = winpr_fopen("/etc/mnttab", "r");
if (f == NULL) if (f == NULL)
{ {
WLog_ERR(TAG, "fopen failed!"); WLog_ERR(TAG, "fopen failed!");
@ -771,7 +771,7 @@ static UINT handle_platform_mounts_linux(hotplug_dev* dev_array, size_t* size)
{ {
FILE* f; FILE* f;
struct mntent* ent; struct mntent* ent;
f = fopen("/proc/mounts", "r"); f = winpr_fopen("/proc/mounts", "r");
if (f == NULL) if (f == NULL)
{ {
WLog_ERR(TAG, "fopen failed!"); WLog_ERR(TAG, "fopen failed!");

View File

@ -41,9 +41,8 @@ int main(int argc, char* argv[])
DWORD dwExitCode; DWORD dwExitCode;
rdpContext* context; rdpContext* context;
rdpSettings* settings; rdpSettings* settings;
RDP_CLIENT_ENTRY_POINTS clientEntryPoints; RDP_CLIENT_ENTRY_POINTS clientEntryPoints = { 0 };
ZeroMemory(&clientEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS));
clientEntryPoints.Size = sizeof(RDP_CLIENT_ENTRY_POINTS); clientEntryPoints.Size = sizeof(RDP_CLIENT_ENTRY_POINTS);
clientEntryPoints.Version = RDP_CLIENT_INTERFACE_VERSION; clientEntryPoints.Version = RDP_CLIENT_INTERFACE_VERSION;

View File

@ -34,6 +34,11 @@ typedef struct xf_window xfWindow;
#include "xfreerdp.h" #include "xfreerdp.h"
// Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html // Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1 #define _NET_WM_MOVERESIZE_SIZE_TOP 1
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 #define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
@ -51,6 +56,10 @@ typedef struct xf_window xfWindow;
#define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
enum xf_localmove_state enum xf_localmove_state
{ {
LMS_NOT_ACTIVE, LMS_NOT_ACTIVE,

View File

@ -120,11 +120,11 @@ extern "C"
}; };
typedef enum _RFX_STATE RFX_STATE; typedef enum _RFX_STATE RFX_STATE;
#define _RFX_DECODED_SYNC 0x00000001 #define RFX_DECODED_SYNC 0x00000001
#define _RFX_DECODED_CONTEXT 0x00000002 #define RFX_DECODED_CONTEXT 0x00000002
#define _RFX_DECODED_VERSIONS 0x00000004 #define RFX_DECODED_VERSIONS 0x00000004
#define _RFX_DECODED_CHANNELS 0x00000008 #define RFX_DECODED_CHANNELS 0x00000008
#define _RFX_DECODED_HEADERS 0x0000000F #define RFX_DECODED_HEADERS 0x0000000F
struct _RFX_CONTEXT struct _RFX_CONTEXT
{ {

View File

@ -434,7 +434,7 @@ BOOL rfx_context_reset(RFX_CONTEXT* context, UINT32 width, UINT32 height)
static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s) static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s)
{ {
UINT32 magic; UINT32 magic;
context->decodedHeaderBlocks &= ~_RFX_DECODED_SYNC; context->decodedHeaderBlocks &= ~RFX_DECODED_SYNC;
/* RFX_SYNC */ /* RFX_SYNC */
if (Stream_GetRemainingLength(s) < 6) if (Stream_GetRemainingLength(s) < 6)
@ -458,14 +458,14 @@ static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s)
} }
WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%08" PRIX32 "", context->version); WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%08" PRIX32 "", context->version);
context->decodedHeaderBlocks |= _RFX_DECODED_SYNC; context->decodedHeaderBlocks |= RFX_DECODED_SYNC;
return TRUE; return TRUE;
} }
static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s) static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s)
{ {
BYTE numCodecs; BYTE numCodecs;
context->decodedHeaderBlocks &= ~_RFX_DECODED_VERSIONS; context->decodedHeaderBlocks &= ~RFX_DECODED_VERSIONS;
if (Stream_GetRemainingLength(s) < 4) if (Stream_GetRemainingLength(s) < 4)
{ {
@ -499,7 +499,7 @@ static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s)
WLog_Print(context->priv->log, WLOG_DEBUG, "id %" PRIu32 " version 0x%" PRIX32 ".", WLog_Print(context->priv->log, WLOG_DEBUG, "id %" PRIu32 " version 0x%" PRIX32 ".",
context->codec_id, context->codec_version); context->codec_id, context->codec_version);
context->decodedHeaderBlocks |= _RFX_DECODED_VERSIONS; context->decodedHeaderBlocks |= RFX_DECODED_VERSIONS;
return TRUE; return TRUE;
} }
@ -507,7 +507,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s)
{ {
BYTE channelId; BYTE channelId;
BYTE numChannels; BYTE numChannels;
context->decodedHeaderBlocks &= ~_RFX_DECODED_CHANNELS; context->decodedHeaderBlocks &= ~RFX_DECODED_CHANNELS;
if (Stream_GetRemainingLength(s) < 1) if (Stream_GetRemainingLength(s) < 1)
{ {
@ -557,7 +557,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s)
WLog_Print(context->priv->log, WLOG_DEBUG, WLog_Print(context->priv->log, WLOG_DEBUG,
"numChannels %" PRIu8 " id %" PRIu8 ", %" PRIu16 "x%" PRIu16 ".", numChannels, "numChannels %" PRIu8 " id %" PRIu8 ", %" PRIu16 "x%" PRIu16 ".", numChannels,
channelId, context->width, context->height); channelId, context->width, context->height);
context->decodedHeaderBlocks |= _RFX_DECODED_CHANNELS; context->decodedHeaderBlocks |= RFX_DECODED_CHANNELS;
return TRUE; return TRUE;
} }
@ -566,7 +566,7 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s)
BYTE ctxId; BYTE ctxId;
UINT16 tileSize; UINT16 tileSize;
UINT16 properties; UINT16 properties;
context->decodedHeaderBlocks &= ~_RFX_DECODED_CONTEXT; context->decodedHeaderBlocks &= ~RFX_DECODED_CONTEXT;
if (Stream_GetRemainingLength(s) < 5) if (Stream_GetRemainingLength(s) < 5)
{ {
@ -609,7 +609,7 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s)
return FALSE; return FALSE;
} }
context->decodedHeaderBlocks |= _RFX_DECODED_CONTEXT; context->decodedHeaderBlocks |= RFX_DECODED_CONTEXT;
return TRUE; return TRUE;
} }
@ -1075,7 +1075,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
return FALSE; return FALSE;
} }
if (blockType > WBT_CONTEXT && context->decodedHeaderBlocks != _RFX_DECODED_HEADERS) if (blockType > WBT_CONTEXT && context->decodedHeaderBlocks != RFX_DECODED_HEADERS)
{ {
WLog_ERR(TAG, "%s: incomplete header blocks processing", __FUNCTION__); WLog_ERR(TAG, "%s: incomplete header blocks processing", __FUNCTION__);
return FALSE; return FALSE;

View File

@ -887,6 +887,7 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg)
testPeerContext* context; testPeerContext* context;
struct server_info* info; struct server_info* info;
freerdp_peer* client = (freerdp_peer*)arg; freerdp_peer* client = (freerdp_peer*)arg;
const char* key = "server.key"; const char* key = "server.key";
const char* cert = "server.crt"; const char* cert = "server.crt";
@ -1094,16 +1095,26 @@ static const struct
const char skey[6]; const char skey[6];
} options = { "--pcap=", "--fast", "--port=", "--local-only", "--cert=", "--key=" }; } options = { "--pcap=", "--fast", "--port=", "--local-only", "--cert=", "--key=" };
static void print_entry(FILE* fp, const char* fmt, const char* what, size_t size)
{
char buffer[32] = { 0 };
strncpy(buffer, what, MIN(size, sizeof(buffer)));
fprintf(fp, fmt, buffer);
}
static WINPR_NORETURN(void usage(const char* app, const char* invalid)) static WINPR_NORETURN(void usage(const char* app, const char* invalid))
{ {
FILE* fp = stdout; FILE* fp = stdout;
fprintf(fp, "Invalid argument '%s'\n", invalid); fprintf(fp, "Invalid argument '%s'\n", invalid);
fprintf(fp, "Usage: %s <arg>[ <arg> ...]\n", app); fprintf(fp, "Usage: %s <arg>[ <arg> ...]\n", app);
fprintf(fp, "Arguments:\n"); fprintf(fp, "Arguments:\n");
fprintf(fp, "\t%s<pcap file>\n", options.spcap); print_entry(fp, "\t%s<pcap file>\n", options.spcap, sizeof(options.spcap));
fprintf(fp, "\t%s\n", options.sfast); print_entry(fp, "\t%s<cert file>\n", options.scert, sizeof(options.scert));
fprintf(fp, "\t%s<port>\n", options.sport); print_entry(fp, "\t%s<key file>\n", options.skey, sizeof(options.skey));
fprintf(fp, "\t%s\n", options.slocal_only); print_entry(fp, "\t%s\n", options.sfast, sizeof(options.sfast));
print_entry(fp, "\t%s<port>\n", options.sport, sizeof(options.sport));
print_entry(fp, "\t%s\n", options.slocal_only, sizeof(options.slocal_only));
exit(-1); exit(-1);
} }

View File

@ -21,8 +21,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef _FREERDP_SERVER_PROXY_SERVER_H #ifndef INT_FREERDP_SERVER_PROXY_SERVER_H
#define _FREERDP_SERVER_PROXY_SERVER_H #define INT_FREERDP_SERVER_PROXY_SERVER_H
#include <winpr/collections.h> #include <winpr/collections.h>
#include <freerdp/listener.h> #include <freerdp/listener.h>
@ -41,4 +41,4 @@ struct proxy_server
HANDLE stopEvent; /* an event used to signal the main thread to stop */ HANDLE stopEvent; /* an event used to signal the main thread to stop */
}; };
#endif /* _FREERDP_SERVER_PROXY_SERVER_H */ #endif /* FREERDP_SERVER_PROXY_SERVER_H */

View File

@ -27,8 +27,17 @@
* Functions have been renamed just to prevent name clashes. * Functions have been renamed just to prevent name clashes.
*/ */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define _GNU_SOURCE #define _GNU_SOURCE
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#define USE_SHM #define USE_SHM
#endif #endif

View File

@ -122,11 +122,20 @@ extern "C"
/* Data Alignment */ /* Data Alignment */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef _ERRNO_T_DEFINED #ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED #define _ERRNO_T_DEFINED
typedef int errno_t; typedef int errno_t;
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -129,11 +129,20 @@
#define HRESULT_FROM_NT(x) ((HRESULT)((x) | FACILITY_NT_BIT)) #define HRESULT_FROM_NT(x) ((HRESULT)((x) | FACILITY_NT_BIT))
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define __HRESULT_FROM_WIN32(x) \ #define __HRESULT_FROM_WIN32(x) \
((HRESULT)(x) <= 0 ? ((HRESULT)(x)) \ ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) \
: ((HRESULT)(((x)&0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000))) : ((HRESULT)(((x)&0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))
#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x) #define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x)
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1) #define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)

View File

@ -78,10 +78,19 @@ extern "C"
#else /* _WIN64 */ #else /* _WIN64 */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define WINPR_SLIST_ENTRY WINPR_SINGLE_LIST_ENTRY #define WINPR_SLIST_ENTRY WINPR_SINGLE_LIST_ENTRY
#define _WINPR_SLIST_ENTRY _WINPR_SINGLE_LIST_ENTRY #define _WINPR_SLIST_ENTRY _WINPR_SINGLE_LIST_ENTRY
#define WINPR_PSLIST_ENTRY WINPR_PSINGLE_LIST_ENTRY #define WINPR_PSLIST_ENTRY WINPR_PSINGLE_LIST_ENTRY
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif /* _WIN64 */ #endif /* _WIN64 */
#ifdef _WIN64 #ifdef _WIN64

View File

@ -25,7 +25,17 @@
#ifndef _WIN32 #ifndef _WIN32
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define __RPC_WIN32__ 1 #define __RPC_WIN32__ 1
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#define TARGET_IS_NT50_OR_LATER 1 #define TARGET_IS_NT50_OR_LATER 1
typedef union _CLIENT_CALL_RETURN { typedef union _CLIENT_CALL_RETURN {

View File

@ -24,6 +24,11 @@
#include <winpr/wtypes.h> #include <winpr/wtypes.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
/* /*
* Processor Architectures: * Processor Architectures:
* http://sourceforge.net/p/predef/wiki/Architectures/ * http://sourceforge.net/p/predef/wiki/Architectures/
@ -287,4 +292,8 @@
#endif /* __BYTE_ORDER */ #endif /* __BYTE_ORDER */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif /* WINPR_PLATFORM_H */ #endif /* WINPR_PLATFORM_H */

View File

@ -28,10 +28,19 @@
#include <winpr/io.h> #include <winpr/io.h>
#include <winpr/error.h> #include <winpr/error.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef _WINSCARD_H_ #ifndef _WINSCARD_H_
#define _WINSCARD_H_ /* do not include winscard.h */ #define _WINSCARD_H_ /* do not include winscard.h */
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#ifndef SCARD_S_SUCCESS #ifndef SCARD_S_SUCCESS
#define SCARD_S_SUCCESS NO_ERROR #define SCARD_S_SUCCESS NO_ERROR

View File

@ -31,9 +31,9 @@
#else #else
#if defined(__GNUC__) #if defined(__clang__)
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wreserved-id-macro" #pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif #endif
#define DUMMYUNIONNAME u #define DUMMYUNIONNAME u
@ -959,8 +959,8 @@ extern "C++"
#define CONTAINING_RECORD(address, type, field) \ #define CONTAINING_RECORD(address, type, field) \
((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field))) ((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field)))
#if defined(__GNUC__) #if defined(__clang__)
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#endif #endif
#endif #endif

View File

@ -55,11 +55,20 @@ typedef struct _SECURITY_INTEGER SECURITY_INTEGER;
typedef SECURITY_INTEGER TimeStamp; typedef SECURITY_INTEGER TimeStamp;
typedef SECURITY_INTEGER* PTimeStamp; typedef SECURITY_INTEGER* PTimeStamp;
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef __SECSTATUS_DEFINED__ #ifndef __SECSTATUS_DEFINED__
typedef LONG SECURITY_STATUS; typedef LONG SECURITY_STATUS;
#define __SECSTATUS_DEFINED__ #define __SECSTATUS_DEFINED__
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
struct _SecPkgInfoA struct _SecPkgInfoA
{ {
UINT32 fCapabilities; UINT32 fCapabilities;
@ -585,6 +594,11 @@ typedef SecPkgCredentials_NamesW* PSecPkgCredentials_NamesW;
#if !defined(_WIN32) || defined(_UWP) #if !defined(_WIN32) || defined(_UWP)
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef _AUTH_IDENTITY_DEFINED #ifndef _AUTH_IDENTITY_DEFINED
#define _AUTH_IDENTITY_DEFINED #define _AUTH_IDENTITY_DEFINED
@ -627,6 +641,10 @@ typedef struct _SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY;
#endif /* _AUTH_IDENTITY_DEFINED */ #endif /* _AUTH_IDENTITY_DEFINED */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
struct _SecHandle struct _SecHandle
{ {
ULONG_PTR dwLower; ULONG_PTR dwLower;

View File

@ -293,9 +293,18 @@ extern "C"
InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount) InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef _RTL_RUN_ONCE_DEF #ifndef _RTL_RUN_ONCE_DEF
#define _RTL_RUN_ONCE_DEF #define _RTL_RUN_ONCE_DEF
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#define RTL_RUN_ONCE_INIT \ #define RTL_RUN_ONCE_INIT \
{ \ { \
0 \ 0 \

View File

@ -17,8 +17,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _WINPR_VERSION_H_ #ifndef WINPR_VERSION_H_
#define _WINPR_VERSION_H_ #define WINPR_VERSION_H_
#define WINPR_VERSION_MAJOR ${WINPR_VERSION_MAJOR} #define WINPR_VERSION_MAJOR ${WINPR_VERSION_MAJOR}
#define WINPR_VERSION_MINOR ${WINPR_VERSION_MINOR} #define WINPR_VERSION_MINOR ${WINPR_VERSION_MINOR}

View File

@ -184,12 +184,21 @@ typedef union sockaddr_gen {
struct sockaddr_in6_old AddressIn6; struct sockaddr_in6_old AddressIn6;
} sockaddr_gen; } sockaddr_gen;
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define _IFF_UP 0x00000001 #define _IFF_UP 0x00000001
#define _IFF_BROADCAST 0x00000002 #define _IFF_BROADCAST 0x00000002
#define _IFF_LOOPBACK 0x00000004 #define _IFF_LOOPBACK 0x00000004
#define _IFF_POINTTOPOINT 0x00000008 #define _IFF_POINTTOPOINT 0x00000008
#define _IFF_MULTICAST 0x00000010 #define _IFF_MULTICAST 0x00000010
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
struct _INTERFACE_INFO struct _INTERFACE_INFO
{ {
ULONG iiFlags; ULONG iiFlags;

View File

@ -76,6 +76,11 @@ typedef LONG_PTR SSIZE_T;
#define VOID void #define VOID void
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef _WIN32 #ifndef _WIN32
#define CALLBACK #define CALLBACK
@ -569,4 +574,8 @@ typedef const BYTE* LPCBYTE;
#define _ftelli64(fp) ftello(fp) #define _ftelli64(fp) ftello(fp)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif /* WINPR_WTYPES_H */ #endif /* WINPR_WTYPES_H */

View File

@ -21,7 +21,17 @@
#include "config.h" #include "config.h"
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#define WIN32_FILETIME_TO_UNIX_EPOCH UINT64_C(11644473600) #define WIN32_FILETIME_TO_UNIX_EPOCH UINT64_C(11644473600)
#include <stddef.h> #include <stddef.h>

View File

@ -48,7 +48,7 @@
#define TTY_THRESHOLD_UNTHROTTLE 128 #define TTY_THRESHOLD_UNTHROTTLE 128
#define N_TTY_BUF_SIZE 4096 #define N_TTY_BUF_SIZE 4096
#define _BAUD_TABLE_END 0010020 /* __MAX_BAUD + 1 */ #define BAUD_TABLE_END 0010020 /* __MAX_BAUD + 1 */
/* 0: B* (Linux termios) /* 0: B* (Linux termios)
* 1: CBR_* or actual baud rate * 1: CBR_* or actual baud rate
@ -153,7 +153,7 @@ static const speed_t _BAUD_TABLE[][3] = {
#ifdef B4000000 #ifdef B4000000
{ B4000000, 4000000, BAUD_USER }, /* __MAX_BAUD */ { B4000000, 4000000, BAUD_USER }, /* __MAX_BAUD */
#endif #endif
{ _BAUD_TABLE_END, 0, 0 } { BAUD_TABLE_END, 0, 0 }
}; };
static BOOL _get_properties(WINPR_COMM* pComm, COMMPROP* pProperties) static BOOL _get_properties(WINPR_COMM* pComm, COMMPROP* pProperties)
@ -200,7 +200,7 @@ static BOOL _get_properties(WINPR_COMM* pComm, COMMPROP* pProperties)
SP_PARITY_CHECK | /*SP_RLSD |*/ SP_STOPBITS; SP_PARITY_CHECK | /*SP_RLSD |*/ SP_STOPBITS;
pProperties->dwSettableBaud = 0; pProperties->dwSettableBaud = 0;
for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) for (i = 0; _BAUD_TABLE[i][0] < BAUD_TABLE_END; i++)
{ {
pProperties->dwSettableBaud |= _BAUD_TABLE[i][2]; pProperties->dwSettableBaud |= _BAUD_TABLE[i][2];
} }
@ -236,7 +236,7 @@ static BOOL _set_baud_rate(WINPR_COMM* pComm, const SERIAL_BAUD_RATE* pBaudRate)
return FALSE; return FALSE;
} }
for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) for (i = 0; _BAUD_TABLE[i][0] < BAUD_TABLE_END; i++)
{ {
if (_BAUD_TABLE[i][1] == pBaudRate->BaudRate) if (_BAUD_TABLE[i][1] == pBaudRate->BaudRate)
{ {
@ -282,7 +282,7 @@ static BOOL _get_baud_rate(WINPR_COMM* pComm, SERIAL_BAUD_RATE* pBaudRate)
currentSpeed = cfgetispeed(&currentState); currentSpeed = cfgetispeed(&currentState);
for (i = 0; _BAUD_TABLE[i][0] < _BAUD_TABLE_END; i++) for (i = 0; _BAUD_TABLE[i][0] < BAUD_TABLE_END; i++)
{ {
if (_BAUD_TABLE[i][0] == currentSpeed) if (_BAUD_TABLE[i][0] == currentSpeed)
{ {

View File

@ -1,8 +1,8 @@
/* /*
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR '\\' #define CUR_PATH_SEPARATOR_CHR '\\'
#define _PATH_SEPARATOR_STR "\\" #define CUR_PATH_SEPARATOR_STR "\\"
#define PATH_ALLOC_COMBINE PathAllocCombineA #define PATH_ALLOC_COMBINE PathAllocCombineA
*/ */
@ -51,12 +51,12 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla
if (pszPathInLength < 3) if (pszPathInLength < 3)
return E_FAIL; return E_FAIL;
backslashIn = (pszPathIn[pszPathInLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; backslashIn = (pszPathIn[pszPathInLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
backslashMore = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; backslashMore = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
if (backslashMore) if (backslashMore)
{ {
if ((pszPathIn[1] == ':') && (pszPathIn[2] == _PATH_SEPARATOR_CHR)) if ((pszPathIn[1] == ':') && (pszPathIn[2] == CUR_PATH_SEPARATOR_CHR))
{ {
size_t sizeOfBuffer; size_t sizeOfBuffer;
pszPathOutLength = 2 + pszMoreLength; pszPathOutLength = 2 + pszMoreLength;
@ -84,7 +84,7 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla
if (backslashIn) if (backslashIn)
swprintf_s(pszPathOut, sizeOfBuffer, L"%s%s", pszPathIn, pszMore); swprintf_s(pszPathOut, sizeOfBuffer, L"%s%s", pszPathIn, pszMore);
else else
swprintf_s(pszPathOut, sizeOfBuffer, L"%s" _PATH_SEPARATOR_STR L"%s", pszPathIn, swprintf_s(pszPathOut, sizeOfBuffer, L"%s" CUR_PATH_SEPARATOR_STR L"%s", pszPathIn,
pszMore); pszMore);
*ppszPathOut = pszPathOut; *ppszPathOut = pszPathOut;
@ -126,12 +126,12 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags
if (pszPathInLength < 3) if (pszPathInLength < 3)
return E_FAIL; return E_FAIL;
backslashIn = (pszPathIn[pszPathInLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; backslashIn = (pszPathIn[pszPathInLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
backslashMore = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; backslashMore = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
if (backslashMore) if (backslashMore)
{ {
if ((pszPathIn[1] == ':') && (pszPathIn[2] == _PATH_SEPARATOR_CHR)) if ((pszPathIn[1] == ':') && (pszPathIn[2] == CUR_PATH_SEPARATOR_CHR))
{ {
size_t sizeOfBuffer; size_t sizeOfBuffer;
pszPathOutLength = 2 + pszMoreLength; pszPathOutLength = 2 + pszMoreLength;
@ -159,7 +159,8 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags
if (backslashIn) if (backslashIn)
sprintf_s(pszPathOut, sizeOfBuffer, "%s%s", pszPathIn, pszMore); sprintf_s(pszPathOut, sizeOfBuffer, "%s%s", pszPathIn, pszMore);
else else
sprintf_s(pszPathOut, sizeOfBuffer, "%s" _PATH_SEPARATOR_STR "%s", pszPathIn, pszMore); sprintf_s(pszPathOut, sizeOfBuffer, "%s" CUR_PATH_SEPARATOR_STR "%s", pszPathIn,
pszMore);
*ppszPathOut = pszPathOut; *ppszPathOut = pszPathOut;
return S_OK; return S_OK;
@ -172,7 +173,7 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags
/* /*
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
*/ */

View File

@ -1,7 +1,7 @@
/* /*
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR '\\' #define CUR_PATH_SEPARATOR_CHR '\\'
#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA #define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA
*/ */
@ -27,7 +27,7 @@ HRESULT PATH_CCH_ADD_EXTENSION(PWSTR pszPath, size_t cchPath, PCWSTR pszExt)
bExtDot = (pszExt[0] == '.') ? TRUE : FALSE; bExtDot = (pszExt[0] == '.') ? TRUE : FALSE;
pDot = wcsrchr(pszPath, '.'); pDot = wcsrchr(pszPath, '.');
pBackslash = wcsrchr(pszPath, _PATH_SEPARATOR_CHR); pBackslash = wcsrchr(pszPath, CUR_PATH_SEPARATOR_CHR);
if (pDot && pBackslash) if (pDot && pBackslash)
{ {
@ -69,7 +69,7 @@ HRESULT PATH_CCH_ADD_EXTENSION(PSTR pszPath, size_t cchPath, PCSTR pszExt)
bExtDot = (pszExt[0] == '.') ? TRUE : FALSE; bExtDot = (pszExt[0] == '.') ? TRUE : FALSE;
pDot = strrchr(pszPath, '.'); pDot = strrchr(pszPath, '.');
pBackslash = strrchr(pszPath, _PATH_SEPARATOR_CHR); pBackslash = strrchr(pszPath, CUR_PATH_SEPARATOR_CHR);
if (pDot && pBackslash) if (pDot && pBackslash)
{ {
@ -94,6 +94,6 @@ HRESULT PATH_CCH_ADD_EXTENSION(PSTR pszPath, size_t cchPath, PCSTR pszExt)
/* /*
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
*/ */

View File

@ -1,7 +1,7 @@
/* /*
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR '\\' #define CUR_PATH_SEPARATOR_CHR '\\'
#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA #define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA
*/ */
@ -16,12 +16,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PWSTR pszPath, size_t cchPath)
pszPathLength = lstrlenW(pszPath); pszPathLength = lstrlenW(pszPath);
if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR)
return S_FALSE; return S_FALSE;
if (cchPath > (pszPathLength + 1)) if (cchPath > (pszPathLength + 1))
{ {
pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR;
pszPath[pszPathLength + 1] = '\0'; pszPath[pszPathLength + 1] = '\0';
return S_OK; return S_OK;
@ -41,12 +41,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PSTR pszPath, size_t cchPath)
pszPathLength = lstrlenA(pszPath); pszPathLength = lstrlenA(pszPath);
if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR)
return S_FALSE; return S_FALSE;
if (cchPath > (pszPathLength + 1)) if (cchPath > (pszPathLength + 1))
{ {
pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR;
pszPath[pszPathLength + 1] = '\0'; pszPath[pszPathLength + 1] = '\0';
return S_OK; return S_OK;
@ -59,6 +59,6 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PSTR pszPath, size_t cchPath)
/* /*
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
*/ */

View File

@ -1,7 +1,7 @@
/* /*
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR '\\' #define CUR_PATH_SEPARATOR_CHR '\\'
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA
*/ */
@ -17,12 +17,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd,
pszPathLength = lstrlenW(pszPath); pszPathLength = lstrlenW(pszPath);
if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR)
return S_FALSE; return S_FALSE;
if (cchPath > (pszPathLength + 1)) if (cchPath > (pszPathLength + 1))
{ {
pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR;
pszPath[pszPathLength + 1] = '\0'; pszPath[pszPathLength + 1] = '\0';
return S_OK; return S_OK;
@ -43,12 +43,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd,
pszPathLength = lstrlenA(pszPath); pszPathLength = lstrlenA(pszPath);
if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR)
return S_FALSE; return S_FALSE;
if (cchPath > (pszPathLength + 1)) if (cchPath > (pszPathLength + 1))
{ {
pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR;
pszPath[pszPathLength + 1] = '\0'; pszPath[pszPathLength + 1] = '\0';
return S_OK; return S_OK;
@ -61,6 +61,6 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd,
/* /*
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
*/ */

View File

@ -1,8 +1,8 @@
/* /*
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR '\\' #define CUR_PATH_SEPARATOR_CHR '\\'
#define _PATH_SEPARATOR_STR "\\" #define CUR_PATH_SEPARATOR_STR "\\"
#define PATH_CCH_APPEND PathCchAppendA #define PATH_CCH_APPEND PathCchAppendA
*/ */
@ -28,8 +28,8 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore)
pszMoreLength = lstrlenW(pszMore); pszMoreLength = lstrlenW(pszMore);
pszPathLength = lstrlenW(pszPath); pszPathLength = lstrlenW(pszPath);
pathBackslash = (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; pathBackslash = (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
moreBackslash = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; moreBackslash = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
if (pathBackslash && moreBackslash) if (pathBackslash && moreBackslash)
{ {
@ -51,8 +51,8 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore)
{ {
if ((pszPathLength + pszMoreLength + 1) < cchPath) if ((pszPathLength + pszMoreLength + 1) < cchPath)
{ {
swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR L"%s", swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength,
pszMore); CUR_PATH_SEPARATOR_STR L"%s", pszMore);
return S_OK; return S_OK;
} }
} }
@ -82,8 +82,8 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore)
pszMoreLength = lstrlenA(pszMore); pszMoreLength = lstrlenA(pszMore);
pszPathLength = lstrlenA(pszPath); pszPathLength = lstrlenA(pszPath);
pathBackslash = (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; pathBackslash = (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
moreBackslash = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; moreBackslash = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
if (pathBackslash && moreBackslash) if (pathBackslash && moreBackslash)
{ {
@ -105,7 +105,7 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore)
{ {
if ((pszPathLength + pszMoreLength + 1) < cchPath) if ((pszPathLength + pszMoreLength + 1) < cchPath)
{ {
sprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR "%s", sprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, CUR_PATH_SEPARATOR_STR "%s",
pszMore); pszMore);
return S_OK; return S_OK;
} }
@ -118,7 +118,7 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore)
/* /*
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
*/ */

View File

@ -73,55 +73,55 @@
/* Windows-style Paths */ /* Windows-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA #define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashW #define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashW
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
/* Unix-style Paths */ /* Unix-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashA #define PATH_CCH_ADD_SEPARATOR PathCchAddSlashA
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddSlashW #define PATH_CCH_ADD_SEPARATOR PathCchAddSlashW
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
/* Native-style Paths */ /* Native-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorA #define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorA
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorW #define PATH_CCH_ADD_SEPARATOR PathCchAddSeparatorW
#include "include/PathCchAddSeparator.c" #include "include/PathCchAddSeparator.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR #undef PATH_CCH_ADD_SEPARATOR
/* /*
@ -147,55 +147,55 @@ HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath)
/* Windows-style Paths */ /* Windows-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExA
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExW #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddBackslashExW
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
/* Unix-style Paths */ /* Unix-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExA #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExA
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExW #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSlashExW
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
/* Native-style Paths */ /* Native-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExA #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExA
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExW #define PATH_CCH_ADD_SEPARATOR_EX PathCchAddSeparatorExW
#include "include/PathCchAddSeparatorEx.c" #include "include/PathCchAddSeparatorEx.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_SEPARATOR_EX #undef PATH_CCH_ADD_SEPARATOR_EX
HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, HRESULT PathCchRemoveBackslashExA(PSTR pszPath, size_t cchPath, PSTR* ppszEnd,
@ -219,55 +219,55 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd,
/* Windows-style Paths */ /* Windows-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA #define PATH_CCH_ADD_EXTENSION PathCchAddExtensionA
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define PATH_CCH_ADD_EXTENSION PathCchAddExtensionW #define PATH_CCH_ADD_EXTENSION PathCchAddExtensionW
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
/* Unix-style Paths */ /* Unix-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionA #define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionA
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionW #define PATH_CCH_ADD_EXTENSION UnixPathCchAddExtensionW
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
/* Native-style Paths */ /* Native-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionA #define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionA
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionW #define PATH_CCH_ADD_EXTENSION NativePathCchAddExtensionW
#include "include/PathCchAddExtension.c" #include "include/PathCchAddExtension.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef PATH_CCH_ADD_EXTENSION #undef PATH_CCH_ADD_EXTENSION
/* /*
@ -277,67 +277,67 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd,
/* Windows-style Paths */ /* Windows-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR #define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR
#define PATH_CCH_APPEND PathCchAppendA #define PATH_CCH_APPEND PathCchAppendA
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W #define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W
#define PATH_CCH_APPEND PathCchAppendW #define PATH_CCH_APPEND PathCchAppendW
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
/* Unix-style Paths */ /* Unix-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define _PATH_SEPARATOR_STR PATH_SLASH_STR #define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR
#define PATH_CCH_APPEND UnixPathCchAppendA #define PATH_CCH_APPEND UnixPathCchAppendA
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W #define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR_W
#define PATH_CCH_APPEND UnixPathCchAppendW #define PATH_CCH_APPEND UnixPathCchAppendW
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
/* Native-style Paths */ /* Native-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR #define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR
#define PATH_CCH_APPEND NativePathCchAppendA #define PATH_CCH_APPEND NativePathCchAppendA
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W #define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W
#define PATH_CCH_APPEND NativePathCchAppendW #define PATH_CCH_APPEND NativePathCchAppendW
#include "include/PathCchAppend.c" #include "include/PathCchAppend.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_CCH_APPEND #undef PATH_CCH_APPEND
/* /*
@ -447,67 +447,67 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn,
/* Windows-style Paths */ /* Windows-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR #define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR
#define PATH_ALLOC_COMBINE PathAllocCombineA #define PATH_ALLOC_COMBINE PathAllocCombineA
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR
#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W #define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W
#define PATH_ALLOC_COMBINE PathAllocCombineW #define PATH_ALLOC_COMBINE PathAllocCombineW
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
/* Unix-style Paths */ /* Unix-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define _PATH_SEPARATOR_STR PATH_SLASH_STR #define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR
#define PATH_ALLOC_COMBINE UnixPathAllocCombineA #define PATH_ALLOC_COMBINE UnixPathAllocCombineA
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR
#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W #define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR_W
#define PATH_ALLOC_COMBINE UnixPathAllocCombineW #define PATH_ALLOC_COMBINE UnixPathAllocCombineW
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
/* Native-style Paths */ /* Native-style Paths */
#define DEFINE_UNICODE FALSE #define DEFINE_UNICODE FALSE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR #define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR
#define PATH_ALLOC_COMBINE NativePathAllocCombineA #define PATH_ALLOC_COMBINE NativePathAllocCombineA
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
#define DEFINE_UNICODE TRUE #define DEFINE_UNICODE TRUE
#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR #define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR
#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W #define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W
#define PATH_ALLOC_COMBINE NativePathAllocCombineW #define PATH_ALLOC_COMBINE NativePathAllocCombineW
#include "include/PathAllocCombine.c" #include "include/PathAllocCombine.c"
#undef DEFINE_UNICODE #undef DEFINE_UNICODE
#undef _PATH_SEPARATOR_CHR #undef CUR_PATH_SEPARATOR_CHR
#undef _PATH_SEPARATOR_STR #undef CUR_PATH_SEPARATOR_STR
#undef PATH_ALLOC_COMBINE #undef PATH_ALLOC_COMBINE
/** /**

View File

@ -21,8 +21,17 @@
#include "config.h" #include "config.h"
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define _NO_KSECDD_IMPORT_ 1 #define _NO_KSECDD_IMPORT_ 1
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#include <winpr/sspi.h> #include <winpr/sspi.h>
#include <winpr/crt.h> #include <winpr/crt.h>

View File

@ -36,6 +36,11 @@
#include <time.h> #include <time.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#ifndef _XOPEN_SOURCE #ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500 #define _XOPEN_SOURCE 500
@ -43,6 +48,10 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
VOID Sleep(DWORD dwMilliseconds) VOID Sleep(DWORD dwMilliseconds)
{ {
usleep(dwMilliseconds * 1000); usleep(dwMilliseconds * 1000);