diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index dbc2242c2..684a9f3f3 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -726,7 +726,7 @@ static UINT handle_platform_mounts_sun(hotplug_dev* dev_array, size_t* size) { FILE* f; struct mnttab ent; - f = fopen("/etc/mnttab", "r"); + f = winpr_fopen("/etc/mnttab", "r"); if (f == NULL) { WLog_ERR(TAG, "fopen failed!"); @@ -771,7 +771,7 @@ static UINT handle_platform_mounts_linux(hotplug_dev* dev_array, size_t* size) { FILE* f; struct mntent* ent; - f = fopen("/proc/mounts", "r"); + f = winpr_fopen("/proc/mounts", "r"); if (f == NULL) { WLog_ERR(TAG, "fopen failed!"); diff --git a/client/X11/cli/xfreerdp.c b/client/X11/cli/xfreerdp.c index 786a7eb5d..7231927aa 100644 --- a/client/X11/cli/xfreerdp.c +++ b/client/X11/cli/xfreerdp.c @@ -41,9 +41,8 @@ int main(int argc, char* argv[]) DWORD dwExitCode; rdpContext* context; 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.Version = RDP_CLIENT_INTERFACE_VERSION; diff --git a/client/X11/xf_window.h b/client/X11/xf_window.h index 3adaa3c7f..d270ff2a5 100644 --- a/client/X11/xf_window.h +++ b/client/X11/xf_window.h @@ -34,6 +34,11 @@ typedef struct xf_window xfWindow; #include "xfreerdp.h" // 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_TOP 1 #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_TOGGLE 2 /* toggle property */ +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + enum xf_localmove_state { LMS_NOT_ACTIVE, diff --git a/include/freerdp/codec/rfx.h b/include/freerdp/codec/rfx.h index 1102ee01d..f71207dac 100644 --- a/include/freerdp/codec/rfx.h +++ b/include/freerdp/codec/rfx.h @@ -120,11 +120,11 @@ extern "C" }; typedef enum _RFX_STATE RFX_STATE; -#define _RFX_DECODED_SYNC 0x00000001 -#define _RFX_DECODED_CONTEXT 0x00000002 -#define _RFX_DECODED_VERSIONS 0x00000004 -#define _RFX_DECODED_CHANNELS 0x00000008 -#define _RFX_DECODED_HEADERS 0x0000000F +#define RFX_DECODED_SYNC 0x00000001 +#define RFX_DECODED_CONTEXT 0x00000002 +#define RFX_DECODED_VERSIONS 0x00000004 +#define RFX_DECODED_CHANNELS 0x00000008 +#define RFX_DECODED_HEADERS 0x0000000F struct _RFX_CONTEXT { diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index db20a391d..b911fc3cb 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -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) { UINT32 magic; - context->decodedHeaderBlocks &= ~_RFX_DECODED_SYNC; + context->decodedHeaderBlocks &= ~RFX_DECODED_SYNC; /* RFX_SYNC */ 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); - context->decodedHeaderBlocks |= _RFX_DECODED_SYNC; + context->decodedHeaderBlocks |= RFX_DECODED_SYNC; return TRUE; } static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s) { BYTE numCodecs; - context->decodedHeaderBlocks &= ~_RFX_DECODED_VERSIONS; + context->decodedHeaderBlocks &= ~RFX_DECODED_VERSIONS; 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 ".", context->codec_id, context->codec_version); - context->decodedHeaderBlocks |= _RFX_DECODED_VERSIONS; + context->decodedHeaderBlocks |= RFX_DECODED_VERSIONS; return TRUE; } @@ -507,7 +507,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) { BYTE channelId; BYTE numChannels; - context->decodedHeaderBlocks &= ~_RFX_DECODED_CHANNELS; + context->decodedHeaderBlocks &= ~RFX_DECODED_CHANNELS; 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, "numChannels %" PRIu8 " id %" PRIu8 ", %" PRIu16 "x%" PRIu16 ".", numChannels, channelId, context->width, context->height); - context->decodedHeaderBlocks |= _RFX_DECODED_CHANNELS; + context->decodedHeaderBlocks |= RFX_DECODED_CHANNELS; return TRUE; } @@ -566,7 +566,7 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s) BYTE ctxId; UINT16 tileSize; UINT16 properties; - context->decodedHeaderBlocks &= ~_RFX_DECODED_CONTEXT; + context->decodedHeaderBlocks &= ~RFX_DECODED_CONTEXT; if (Stream_GetRemainingLength(s) < 5) { @@ -609,7 +609,7 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s) return FALSE; } - context->decodedHeaderBlocks |= _RFX_DECODED_CONTEXT; + context->decodedHeaderBlocks |= RFX_DECODED_CONTEXT; return TRUE; } @@ -1075,7 +1075,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, 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__); return FALSE; diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 21a4fd6aa..b586d72a7 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -887,6 +887,7 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg) testPeerContext* context; struct server_info* info; freerdp_peer* client = (freerdp_peer*)arg; + const char* key = "server.key"; const char* cert = "server.crt"; @@ -1094,16 +1095,26 @@ static const struct const char skey[6]; } 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)) { FILE* fp = stdout; + fprintf(fp, "Invalid argument '%s'\n", invalid); fprintf(fp, "Usage: %s [ ...]\n", app); fprintf(fp, "Arguments:\n"); - fprintf(fp, "\t%s\n", options.spcap); - fprintf(fp, "\t%s\n", options.sfast); - fprintf(fp, "\t%s\n", options.sport); - fprintf(fp, "\t%s\n", options.slocal_only); + print_entry(fp, "\t%s\n", options.spcap, sizeof(options.spcap)); + print_entry(fp, "\t%s\n", options.scert, sizeof(options.scert)); + print_entry(fp, "\t%s\n", options.skey, sizeof(options.skey)); + print_entry(fp, "\t%s\n", options.sfast, sizeof(options.sfast)); + print_entry(fp, "\t%s\n", options.sport, sizeof(options.sport)); + print_entry(fp, "\t%s\n", options.slocal_only, sizeof(options.slocal_only)); exit(-1); } diff --git a/server/proxy/pf_server.h b/server/proxy/pf_server.h index 8c665020d..1b9cc2c5e 100644 --- a/server/proxy/pf_server.h +++ b/server/proxy/pf_server.h @@ -21,8 +21,8 @@ * limitations under the License. */ -#ifndef _FREERDP_SERVER_PROXY_SERVER_H -#define _FREERDP_SERVER_PROXY_SERVER_H +#ifndef INT_FREERDP_SERVER_PROXY_SERVER_H +#define INT_FREERDP_SERVER_PROXY_SERVER_H #include #include @@ -41,4 +41,4 @@ struct proxy_server HANDLE stopEvent; /* an event used to signal the main thread to stop */ }; -#endif /* _FREERDP_SERVER_PROXY_SERVER_H */ +#endif /* FREERDP_SERVER_PROXY_SERVER_H */ diff --git a/uwac/libuwac/uwac-os.c b/uwac/libuwac/uwac-os.c index 31302e753..deb62beb7 100644 --- a/uwac/libuwac/uwac-os.c +++ b/uwac/libuwac/uwac-os.c @@ -27,8 +27,17 @@ * 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 +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #if defined(__FreeBSD__) || defined(__DragonFly__) #define USE_SHM #endif diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h index 34bad526f..66aa4a79b 100644 --- a/winpr/include/winpr/crt.h +++ b/winpr/include/winpr/crt.h @@ -122,11 +122,20 @@ extern "C" /* Data Alignment */ +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef _ERRNO_T_DEFINED #define _ERRNO_T_DEFINED typedef int errno_t; #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #ifdef __cplusplus extern "C" { diff --git a/winpr/include/winpr/error.h b/winpr/include/winpr/error.h index 1678ef6bd..02c67d23d 100644 --- a/winpr/include/winpr/error.h +++ b/winpr/include/winpr/error.h @@ -129,11 +129,20 @@ #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) \ ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) \ : ((HRESULT)(((x)&0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000))) #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 SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) diff --git a/winpr/include/winpr/interlocked.h b/winpr/include/winpr/interlocked.h index 5be208598..f641dd52b 100644 --- a/winpr/include/winpr/interlocked.h +++ b/winpr/include/winpr/interlocked.h @@ -78,10 +78,19 @@ extern "C" #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_PSLIST_ENTRY WINPR_PSINGLE_LIST_ENTRY +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #endif /* _WIN64 */ #ifdef _WIN64 diff --git a/winpr/include/winpr/ndr.h b/winpr/include/winpr/ndr.h index 2580a6ce6..eb5a6ce02 100644 --- a/winpr/include/winpr/ndr.h +++ b/winpr/include/winpr/ndr.h @@ -25,7 +25,17 @@ #ifndef _WIN32 +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #define __RPC_WIN32__ 1 + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #define TARGET_IS_NT50_OR_LATER 1 typedef union _CLIENT_CALL_RETURN { diff --git a/winpr/include/winpr/platform.h b/winpr/include/winpr/platform.h index f6f3c97d6..4dcaff0a9 100644 --- a/winpr/include/winpr/platform.h +++ b/winpr/include/winpr/platform.h @@ -24,6 +24,11 @@ #include +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + /* * Processor Architectures: * http://sourceforge.net/p/predef/wiki/Architectures/ @@ -287,4 +292,8 @@ #endif /* __BYTE_ORDER */ +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #endif /* WINPR_PLATFORM_H */ diff --git a/winpr/include/winpr/smartcard.h b/winpr/include/winpr/smartcard.h index e19a6ee02..5303922b2 100644 --- a/winpr/include/winpr/smartcard.h +++ b/winpr/include/winpr/smartcard.h @@ -28,10 +28,19 @@ #include #include +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef _WINSCARD_H_ #define _WINSCARD_H_ /* do not include winscard.h */ #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #ifndef SCARD_S_SUCCESS #define SCARD_S_SUCCESS NO_ERROR diff --git a/winpr/include/winpr/spec.h b/winpr/include/winpr/spec.h index 521e6b421..d1a2d740a 100644 --- a/winpr/include/winpr/spec.h +++ b/winpr/include/winpr/spec.h @@ -31,9 +31,9 @@ #else -#if defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wreserved-id-macro" +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #endif #define DUMMYUNIONNAME u @@ -959,8 +959,8 @@ extern "C++" #define CONTAINING_RECORD(address, type, field) \ ((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field))) -#if defined(__GNUC__) -#pragma GCC diagnostic pop +#if defined(__clang__) +#pragma clang diagnostic pop #endif #endif diff --git a/winpr/include/winpr/sspi.h b/winpr/include/winpr/sspi.h index d5e536a24..71b168b43 100644 --- a/winpr/include/winpr/sspi.h +++ b/winpr/include/winpr/sspi.h @@ -55,11 +55,20 @@ typedef struct _SECURITY_INTEGER SECURITY_INTEGER; typedef SECURITY_INTEGER TimeStamp; typedef SECURITY_INTEGER* PTimeStamp; +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef __SECSTATUS_DEFINED__ typedef LONG SECURITY_STATUS; #define __SECSTATUS_DEFINED__ #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + struct _SecPkgInfoA { UINT32 fCapabilities; @@ -585,6 +594,11 @@ typedef SecPkgCredentials_NamesW* PSecPkgCredentials_NamesW; #if !defined(_WIN32) || defined(_UWP) +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef _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 */ +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + struct _SecHandle { ULONG_PTR dwLower; diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h index 5b15c41d2..f11446a88 100644 --- a/winpr/include/winpr/synch.h +++ b/winpr/include/winpr/synch.h @@ -293,9 +293,18 @@ extern "C" InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount) #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef _RTL_RUN_ONCE_DEF #define _RTL_RUN_ONCE_DEF +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #define RTL_RUN_ONCE_INIT \ { \ 0 \ diff --git a/winpr/include/winpr/version.h.in b/winpr/include/winpr/version.h.in index ef209bbfb..8b8c0abaf 100644 --- a/winpr/include/winpr/version.h.in +++ b/winpr/include/winpr/version.h.in @@ -17,8 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef _WINPR_VERSION_H_ -#define _WINPR_VERSION_H_ +#ifndef WINPR_VERSION_H_ +#define WINPR_VERSION_H_ #define WINPR_VERSION_MAJOR ${WINPR_VERSION_MAJOR} #define WINPR_VERSION_MINOR ${WINPR_VERSION_MINOR} diff --git a/winpr/include/winpr/winsock.h b/winpr/include/winpr/winsock.h index 167760920..c13d6c7ed 100644 --- a/winpr/include/winpr/winsock.h +++ b/winpr/include/winpr/winsock.h @@ -184,12 +184,21 @@ typedef union sockaddr_gen { struct sockaddr_in6_old AddressIn6; } sockaddr_gen; +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #define _IFF_UP 0x00000001 #define _IFF_BROADCAST 0x00000002 #define _IFF_LOOPBACK 0x00000004 #define _IFF_POINTTOPOINT 0x00000008 #define _IFF_MULTICAST 0x00000010 +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + struct _INTERFACE_INFO { ULONG iiFlags; diff --git a/winpr/include/winpr/wtypes.h.in b/winpr/include/winpr/wtypes.h.in index d2648908b..e4ee27a5b 100644 --- a/winpr/include/winpr/wtypes.h.in +++ b/winpr/include/winpr/wtypes.h.in @@ -76,6 +76,11 @@ typedef LONG_PTR SSIZE_T; #define VOID void #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifndef _WIN32 #define CALLBACK @@ -569,4 +574,8 @@ typedef const BYTE* LPCBYTE; #define _ftelli64(fp) ftello(fp) #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #endif /* WINPR_WTYPES_H */ diff --git a/winpr/libwinpr/clipboard/posix.c b/winpr/libwinpr/clipboard/posix.c index 635f7c2f2..23f7b669f 100644 --- a/winpr/libwinpr/clipboard/posix.c +++ b/winpr/libwinpr/clipboard/posix.c @@ -21,7 +21,17 @@ #include "config.h" #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #define _FILE_OFFSET_BITS 64 + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #define WIN32_FILETIME_TO_UNIX_EPOCH UINT64_C(11644473600) #include diff --git a/winpr/libwinpr/comm/comm_serial_sys.c b/winpr/libwinpr/comm/comm_serial_sys.c index 4834bcd6d..ce8934ecd 100644 --- a/winpr/libwinpr/comm/comm_serial_sys.c +++ b/winpr/libwinpr/comm/comm_serial_sys.c @@ -48,7 +48,7 @@ #define TTY_THRESHOLD_UNTHROTTLE 128 #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) * 1: CBR_* or actual baud rate @@ -153,7 +153,7 @@ static const speed_t _BAUD_TABLE[][3] = { #ifdef B4000000 { B4000000, 4000000, BAUD_USER }, /* __MAX_BAUD */ #endif - { _BAUD_TABLE_END, 0, 0 } + { BAUD_TABLE_END, 0, 0 } }; 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; 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]; } @@ -236,7 +236,7 @@ static BOOL _set_baud_rate(WINPR_COMM* pComm, const SERIAL_BAUD_RATE* pBaudRate) 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) { @@ -282,7 +282,7 @@ static BOOL _get_baud_rate(WINPR_COMM* pComm, SERIAL_BAUD_RATE* pBaudRate) currentSpeed = cfgetispeed(¤tState); - 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) { diff --git a/winpr/libwinpr/path/include/PathAllocCombine.c b/winpr/libwinpr/path/include/PathAllocCombine.c index da430a647..68c624ae2 100644 --- a/winpr/libwinpr/path/include/PathAllocCombine.c +++ b/winpr/libwinpr/path/include/PathAllocCombine.c @@ -1,8 +1,8 @@ /* #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR '\\' -#define _PATH_SEPARATOR_STR "\\" +#define CUR_PATH_SEPARATOR_CHR '\\' +#define CUR_PATH_SEPARATOR_STR "\\" #define PATH_ALLOC_COMBINE PathAllocCombineA */ @@ -51,12 +51,12 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla if (pszPathInLength < 3) return E_FAIL; - backslashIn = (pszPathIn[pszPathInLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; - backslashMore = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; + backslashIn = (pszPathIn[pszPathInLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; + backslashMore = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; if (backslashMore) { - if ((pszPathIn[1] == ':') && (pszPathIn[2] == _PATH_SEPARATOR_CHR)) + if ((pszPathIn[1] == ':') && (pszPathIn[2] == CUR_PATH_SEPARATOR_CHR)) { size_t sizeOfBuffer; pszPathOutLength = 2 + pszMoreLength; @@ -84,7 +84,7 @@ HRESULT PATH_ALLOC_COMBINE(PCWSTR pszPathIn, PCWSTR pszMore, unsigned long dwFla if (backslashIn) swprintf_s(pszPathOut, sizeOfBuffer, L"%s%s", pszPathIn, pszMore); 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); *ppszPathOut = pszPathOut; @@ -126,12 +126,12 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags if (pszPathInLength < 3) return E_FAIL; - backslashIn = (pszPathIn[pszPathInLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; - backslashMore = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; + backslashIn = (pszPathIn[pszPathInLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; + backslashMore = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; if (backslashMore) { - if ((pszPathIn[1] == ':') && (pszPathIn[2] == _PATH_SEPARATOR_CHR)) + if ((pszPathIn[1] == ':') && (pszPathIn[2] == CUR_PATH_SEPARATOR_CHR)) { size_t sizeOfBuffer; pszPathOutLength = 2 + pszMoreLength; @@ -159,7 +159,8 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags if (backslashIn) sprintf_s(pszPathOut, sizeOfBuffer, "%s%s", pszPathIn, pszMore); 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; return S_OK; @@ -172,7 +173,7 @@ HRESULT PATH_ALLOC_COMBINE(PCSTR pszPathIn, PCSTR pszMore, unsigned long dwFlags /* #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE */ diff --git a/winpr/libwinpr/path/include/PathCchAddExtension.c b/winpr/libwinpr/path/include/PathCchAddExtension.c index fc385ae0b..a78e229fc 100644 --- a/winpr/libwinpr/path/include/PathCchAddExtension.c +++ b/winpr/libwinpr/path/include/PathCchAddExtension.c @@ -1,7 +1,7 @@ /* #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR '\\' +#define CUR_PATH_SEPARATOR_CHR '\\' #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; pDot = wcsrchr(pszPath, '.'); - pBackslash = wcsrchr(pszPath, _PATH_SEPARATOR_CHR); + pBackslash = wcsrchr(pszPath, CUR_PATH_SEPARATOR_CHR); if (pDot && pBackslash) { @@ -69,7 +69,7 @@ HRESULT PATH_CCH_ADD_EXTENSION(PSTR pszPath, size_t cchPath, PCSTR pszExt) bExtDot = (pszExt[0] == '.') ? TRUE : FALSE; pDot = strrchr(pszPath, '.'); - pBackslash = strrchr(pszPath, _PATH_SEPARATOR_CHR); + pBackslash = strrchr(pszPath, CUR_PATH_SEPARATOR_CHR); if (pDot && pBackslash) { @@ -94,6 +94,6 @@ HRESULT PATH_CCH_ADD_EXTENSION(PSTR pszPath, size_t cchPath, PCSTR pszExt) /* #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION */ diff --git a/winpr/libwinpr/path/include/PathCchAddSeparator.c b/winpr/libwinpr/path/include/PathCchAddSeparator.c index 4a4f6be49..cc1ba4fc8 100644 --- a/winpr/libwinpr/path/include/PathCchAddSeparator.c +++ b/winpr/libwinpr/path/include/PathCchAddSeparator.c @@ -1,7 +1,7 @@ /* #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR '\\' +#define CUR_PATH_SEPARATOR_CHR '\\' #define PATH_CCH_ADD_SEPARATOR PathCchAddBackslashA */ @@ -16,12 +16,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PWSTR pszPath, size_t cchPath) pszPathLength = lstrlenW(pszPath); - if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) + if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) return S_FALSE; if (cchPath > (pszPathLength + 1)) { - pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; + pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR; pszPath[pszPathLength + 1] = '\0'; return S_OK; @@ -41,12 +41,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PSTR pszPath, size_t cchPath) pszPathLength = lstrlenA(pszPath); - if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) + if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) return S_FALSE; if (cchPath > (pszPathLength + 1)) { - pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; + pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR; pszPath[pszPathLength + 1] = '\0'; return S_OK; @@ -59,6 +59,6 @@ HRESULT PATH_CCH_ADD_SEPARATOR(PSTR pszPath, size_t cchPath) /* #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR */ diff --git a/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c b/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c index 154cff6e2..b1836ad65 100644 --- a/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c +++ b/winpr/libwinpr/path/include/PathCchAddSeparatorEx.c @@ -1,7 +1,7 @@ /* #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR '\\' +#define CUR_PATH_SEPARATOR_CHR '\\' #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); - if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) + if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) return S_FALSE; if (cchPath > (pszPathLength + 1)) { - pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; + pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR; pszPath[pszPathLength + 1] = '\0'; return S_OK; @@ -43,12 +43,12 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, pszPathLength = lstrlenA(pszPath); - if (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) + if (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) return S_FALSE; if (cchPath > (pszPathLength + 1)) { - pszPath[pszPathLength] = _PATH_SEPARATOR_CHR; + pszPath[pszPathLength] = CUR_PATH_SEPARATOR_CHR; pszPath[pszPathLength + 1] = '\0'; return S_OK; @@ -61,6 +61,6 @@ HRESULT PATH_CCH_ADD_SEPARATOR_EX(PSTR pszPath, size_t cchPath, PSTR* ppszEnd, /* #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX */ diff --git a/winpr/libwinpr/path/include/PathCchAppend.c b/winpr/libwinpr/path/include/PathCchAppend.c index 4d7045acf..e54f093aa 100644 --- a/winpr/libwinpr/path/include/PathCchAppend.c +++ b/winpr/libwinpr/path/include/PathCchAppend.c @@ -1,8 +1,8 @@ /* #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR '\\' -#define _PATH_SEPARATOR_STR "\\" +#define CUR_PATH_SEPARATOR_CHR '\\' +#define CUR_PATH_SEPARATOR_STR "\\" #define PATH_CCH_APPEND PathCchAppendA */ @@ -28,8 +28,8 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore) pszMoreLength = lstrlenW(pszMore); pszPathLength = lstrlenW(pszPath); - pathBackslash = (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; - moreBackslash = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; + pathBackslash = (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; + moreBackslash = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; if (pathBackslash && moreBackslash) { @@ -51,8 +51,8 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore) { if ((pszPathLength + pszMoreLength + 1) < cchPath) { - swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, _PATH_SEPARATOR_STR L"%s", - pszMore); + swprintf_s(&pszPath[pszPathLength], cchPath - pszPathLength, + CUR_PATH_SEPARATOR_STR L"%s", pszMore); return S_OK; } } @@ -82,8 +82,8 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore) pszMoreLength = lstrlenA(pszMore); pszPathLength = lstrlenA(pszPath); - pathBackslash = (pszPath[pszPathLength - 1] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; - moreBackslash = (pszMore[0] == _PATH_SEPARATOR_CHR) ? TRUE : FALSE; + pathBackslash = (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; + moreBackslash = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE; if (pathBackslash && moreBackslash) { @@ -105,7 +105,7 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore) { 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); return S_OK; } @@ -118,7 +118,7 @@ HRESULT PATH_CCH_APPEND(PSTR pszPath, size_t cchPath, PCSTR pszMore) /* #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND */ diff --git a/winpr/libwinpr/path/path.c b/winpr/libwinpr/path/path.c index b291c8c14..f5a2db5ec 100644 --- a/winpr/libwinpr/path/path.c +++ b/winpr/libwinpr/path/path.c @@ -73,55 +73,55 @@ /* Windows-style Paths */ #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR /* Unix-style Paths */ #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR /* Native-style Paths */ #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR #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 #include "include/PathCchAddSeparator.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR /* @@ -147,55 +147,55 @@ HRESULT PathCchRemoveBackslashW(PWSTR pszPath, size_t cchPath) /* Windows-style Paths */ #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX /* Unix-style Paths */ #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX /* Native-style Paths */ #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX #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 #include "include/PathCchAddSeparatorEx.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_SEPARATOR_EX 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 */ #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION /* Unix-style Paths */ #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION /* Native-style Paths */ #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION #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 #include "include/PathCchAddExtension.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_CHR #undef PATH_CCH_ADD_EXTENSION /* @@ -277,67 +277,67 @@ HRESULT PathCchRemoveBackslashExW(PWSTR pszPath, size_t cchPath, PWSTR* ppszEnd, /* Windows-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR +#define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR #define PATH_CCH_APPEND PathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W #define PATH_CCH_APPEND PathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND /* Unix-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR +#define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR #define PATH_CCH_APPEND UnixPathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR_W #define PATH_CCH_APPEND UnixPathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND /* Native-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR +#define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR #define PATH_CCH_APPEND NativePathCchAppendA #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W #define PATH_CCH_APPEND NativePathCchAppendW #include "include/PathCchAppend.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_CCH_APPEND /* @@ -447,67 +447,67 @@ HRESULT PathCchCombineExW(PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, /* Windows-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR +#define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR #define PATH_ALLOC_COMBINE PathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR -#define _PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_BACKSLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_BACKSLASH_STR_W #define PATH_ALLOC_COMBINE PathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE /* Unix-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR +#define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR #define PATH_ALLOC_COMBINE UnixPathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SLASH_CHR -#define _PATH_SEPARATOR_STR PATH_SLASH_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_SLASH_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SLASH_STR_W #define PATH_ALLOC_COMBINE UnixPathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE /* Native-style Paths */ #define DEFINE_UNICODE FALSE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR +#define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR #define PATH_ALLOC_COMBINE NativePathAllocCombineA #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE #define DEFINE_UNICODE TRUE -#define _PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR -#define _PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W +#define CUR_PATH_SEPARATOR_CHR PATH_SEPARATOR_CHR +#define CUR_PATH_SEPARATOR_STR PATH_SEPARATOR_STR_W #define PATH_ALLOC_COMBINE NativePathAllocCombineW #include "include/PathAllocCombine.c" #undef DEFINE_UNICODE -#undef _PATH_SEPARATOR_CHR -#undef _PATH_SEPARATOR_STR +#undef CUR_PATH_SEPARATOR_CHR +#undef CUR_PATH_SEPARATOR_STR #undef PATH_ALLOC_COMBINE /** diff --git a/winpr/libwinpr/sspi/sspi.c b/winpr/libwinpr/sspi/sspi.c index 9389353e8..73d5dc6f0 100644 --- a/winpr/libwinpr/sspi/sspi.c +++ b/winpr/libwinpr/sspi/sspi.c @@ -21,8 +21,17 @@ #include "config.h" #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #define _NO_KSECDD_IMPORT_ 1 +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #include #include diff --git a/winpr/libwinpr/synch/sleep.c b/winpr/libwinpr/synch/sleep.c index 7de1a3a52..ea54305ce 100644 --- a/winpr/libwinpr/synch/sleep.c +++ b/winpr/libwinpr/synch/sleep.c @@ -36,6 +36,11 @@ #include +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #ifdef HAVE_UNISTD_H #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 @@ -43,6 +48,10 @@ #include #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + VOID Sleep(DWORD dwMilliseconds) { usleep(dwMilliseconds * 1000);