tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP

Rename internal macro to make its purpose more obvious.

After this patch `grep -i uwp` shows all the code related to UWP.

Ref: https://curl.se/mail/lib-2024-09/0014.html
Closes #14881
This commit is contained in:
Viktor Szakats 2024-09-12 13:58:53 +02:00
parent 445fb81237
commit bc2f72b9ae
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
20 changed files with 33 additions and 33 deletions

View File

@ -286,7 +286,7 @@ static CURLcode getaddrinfo_complete(struct Curl_easy *data)
* and wait on it. * and wait on it.
*/ */
static static
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
DWORD DWORD
#else #else
unsigned int unsigned int
@ -354,7 +354,7 @@ CURL_STDCALL getaddrinfo_thread(void *arg)
* gethostbyname_thread() resolves a name and then exits. * gethostbyname_thread() resolves a name and then exits.
*/ */
static static
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
DWORD DWORD
#else #else
unsigned int unsigned int

View File

@ -475,7 +475,7 @@ Vista
#endif #endif
/* Define to use the Windows crypto library. */ /* Define to use the Windows crypto library. */
#if !defined(CURL_WINDOWS_APP) #if !defined(CURL_WINDOWS_UWP)
#define USE_WIN32_CRYPTO #define USE_WIN32_CRYPTO
#endif #endif

View File

@ -109,7 +109,7 @@
# include <winapifamily.h> # include <winapifamily.h>
# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# define CURL_WINDOWS_APP # define CURL_WINDOWS_UWP
# endif # endif
# endif # endif
#endif #endif

View File

@ -103,7 +103,7 @@ int Curl_thread_join(curl_thread_t *hnd)
#elif defined(USE_THREADS_WIN32) #elif defined(USE_THREADS_WIN32)
curl_thread_t Curl_thread_create( curl_thread_t Curl_thread_create(
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
DWORD DWORD
#else #else
unsigned int unsigned int
@ -111,14 +111,14 @@ curl_thread_t Curl_thread_create(
(CURL_STDCALL *func) (void *), (CURL_STDCALL *func) (void *),
void *arg) void *arg)
{ {
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
typedef HANDLE curl_win_thread_handle_t; typedef HANDLE curl_win_thread_handle_t;
#else #else
typedef uintptr_t curl_win_thread_handle_t; typedef uintptr_t curl_win_thread_handle_t;
#endif #endif
curl_thread_t t; curl_thread_t t;
curl_win_thread_handle_t thread_handle; curl_win_thread_handle_t thread_handle;
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
thread_handle = CreateThread(NULL, 0, func, arg, 0, NULL); thread_handle = CreateThread(NULL, 0, func, arg, 0, NULL);
#else #else
thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL); thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL);

View File

@ -53,7 +53,7 @@
#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
curl_thread_t Curl_thread_create( curl_thread_t Curl_thread_create(
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
DWORD DWORD
#else #else
unsigned int unsigned int

View File

@ -31,7 +31,7 @@
static char *GetEnv(const char *variable) static char *GetEnv(const char *variable)
{ {
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) || \ #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) || \
defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */ defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */
(void)variable; (void)variable;
return NULL; return NULL;

View File

@ -49,7 +49,7 @@
#ifdef _WIN32 #ifdef _WIN32
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 && \ #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 && \
!defined(CURL_WINDOWS_APP) !defined(CURL_WINDOWS_UWP)
# define HAVE_WIN_BCRYPTGENRANDOM # define HAVE_WIN_BCRYPTGENRANDOM
# include <bcrypt.h> # include <bcrypt.h>
# ifdef _MSC_VER # ifdef _MSC_VER

View File

@ -175,7 +175,7 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
*/ */
HMODULE Curl_load_library(LPCTSTR filename) HMODULE Curl_load_library(LPCTSTR filename)
{ {
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
HMODULE hModule = NULL; HMODULE hModule = NULL;
LOADLIBRARYEX_FN pLoadLibraryEx = NULL; LOADLIBRARYEX_FN pLoadLibraryEx = NULL;

View File

@ -79,7 +79,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion,
{ {
bool matched = FALSE; bool matched = FALSE;
#if defined(CURL_WINDOWS_APP) #if defined(CURL_WINDOWS_UWP)
/* We have no way to determine the Windows version from Windows apps, /* We have no way to determine the Windows version from Windows apps,
so let's assume we are running on the target Windows version. */ so let's assume we are running on the target Windows version. */
const WORD fullVersion = MAKEWORD(minorVersion, majorVersion); const WORD fullVersion = MAKEWORD(minorVersion, majorVersion);

View File

@ -2732,7 +2732,7 @@ static void schannel_checksum(const unsigned char *input,
DWORD provType, DWORD provType,
const unsigned int algId) const unsigned int algId)
{ {
#ifdef CURL_WINDOWS_APP #ifdef CURL_WINDOWS_UWP
(void)input; (void)input;
(void)inputlen; (void)inputlen;
(void)provType; (void)provType;
@ -2952,7 +2952,7 @@ const struct Curl_ssl Curl_ssl_schannel = {
#ifdef HAS_MANUAL_VERIFY_API #ifdef HAS_MANUAL_VERIFY_API
SSLSUPP_CAINFO_BLOB | SSLSUPP_CAINFO_BLOB |
#endif #endif
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
SSLSUPP_PINNEDPUBKEY | SSLSUPP_PINNEDPUBKEY |
#endif #endif
SSLSUPP_TLS13_CIPHERSUITES | SSLSUPP_TLS13_CIPHERSUITES |

View File

@ -31,7 +31,7 @@
#include "vtls.h" #include "vtls.h"
#if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) \ #if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) \
&& !defined(CURL_WINDOWS_APP) && !defined(CURL_WINDOWS_UWP)
#define HAS_MANUAL_VERIFY_API #define HAS_MANUAL_VERIFY_API
#endif #endif

View File

@ -346,7 +346,7 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
DWORD length) DWORD length)
{ {
DWORD actual_length = 0; DWORD actual_length = 0;
#if defined(CURL_WINDOWS_APP) #if defined(CURL_WINDOWS_UWP)
(void)data; (void)data;
(void)cert_context; (void)cert_context;
(void)host_names; (void)host_names;

View File

@ -66,7 +66,7 @@ unsigned int get_terminal_columns(void)
struct winsize ts; struct winsize ts;
if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts)) if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts))
cols = (int)ts.ws_col; cols = (int)ts.ws_col;
#elif defined(_WIN32) && !defined(CURL_WINDOWS_APP) #elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
{ {
HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE); HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO console_info; CONSOLE_SCREEN_BUFFER_INFO console_info;

View File

@ -621,7 +621,7 @@ CURLcode FindWin32CACert(struct OperationConfig *config,
{ {
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
#ifdef CURL_WINDOWS_APP #ifdef CURL_WINDOWS_UWP
(void)config; (void)config;
(void)backend; (void)backend;
(void)bundle_file; (void)bundle_file;
@ -712,7 +712,7 @@ cleanup:
bool tool_term_has_bold; bool tool_term_has_bold;
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
/* The terminal settings to restore on exit */ /* The terminal settings to restore on exit */
static struct TerminalSettings { static struct TerminalSettings {
HANDLE hStdOut; HANDLE hStdOut;
@ -795,7 +795,7 @@ CURLcode win32_init(void)
QueryPerformanceFrequency(&tool_freq); QueryPerformanceFrequency(&tool_freq);
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
init_terminal(); init_terminal();
#endif #endif

View File

@ -41,7 +41,7 @@ int getfiletime(const char *filename, struct GlobalConfig *global,
/* Windows stat() may attempt to adjust the Unix GMT file time by a daylight /* Windows stat() may attempt to adjust the Unix GMT file time by a daylight
saving time offset and since it is GMT that is bad behavior. When we have saving time offset and since it is GMT that is bad behavior. When we have
access to a 64-bit type we can bypass stat and get the times directly. */ access to a 64-bit type we can bypass stat and get the times directly. */
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP) #if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
HANDLE hfile; HANDLE hfile;
TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename); TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename);
@ -95,7 +95,7 @@ void setfiletime(curl_off_t filetime, const char *filename,
/* Windows utime() may attempt to adjust the Unix GMT file time by a daylight /* Windows utime() may attempt to adjust the Unix GMT file time by a daylight
saving time offset and since it is GMT that is bad behavior. When we have saving time offset and since it is GMT that is bad behavior. When we have
access to a 64-bit type we can bypass utime and set the times directly. */ access to a 64-bit type we can bypass utime and set the times directly. */
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP) #if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
HANDLE hfile; HANDLE hfile;
TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename); TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename);

View File

@ -29,7 +29,7 @@
#define NUM_THREADS 100 #define NUM_THREADS 100
#ifdef _WIN32 #ifdef _WIN32
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
static DWORD WINAPI run_thread(LPVOID ptr) static DWORD WINAPI run_thread(LPVOID ptr)
#else #else
#include <process.h> #include <process.h>
@ -47,7 +47,7 @@ static unsigned int WINAPI run_thread(void *ptr)
CURLcode test(char *URL) CURLcode test(char *URL)
{ {
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
typedef HANDLE curl_win_thread_handle_t; typedef HANDLE curl_win_thread_handle_t;
#else #else
typedef uintptr_t curl_win_thread_handle_t; typedef uintptr_t curl_win_thread_handle_t;
@ -78,7 +78,7 @@ CURLcode test(char *URL)
for(i = 0; i < tid_count; i++) { for(i = 0; i < tid_count; i++) {
curl_win_thread_handle_t th; curl_win_thread_handle_t th;
results[i] = CURL_LAST; /* initialize with invalid value */ results[i] = CURL_LAST; /* initialize with invalid value */
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
th = CreateThread(NULL, 0, run_thread, &results[i], 0, NULL); th = CreateThread(NULL, 0, run_thread, &results[i], 0, NULL);
#else #else
th = _beginthreadex(NULL, 0, run_thread, &results[i], 0, NULL); th = _beginthreadex(NULL, 0, run_thread, &results[i], 0, NULL);

View File

@ -74,7 +74,7 @@ static size_t write_memory_callback(void *contents, size_t size,
static static
#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) #if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP)
DWORD DWORD
#else #else
unsigned int unsigned int

View File

@ -133,7 +133,7 @@ double tutil_tvdiff_secs(struct timeval newer, struct timeval older)
#ifdef _WIN32 #ifdef _WIN32
HMODULE win32_load_system_library(const TCHAR *filename) HMODULE win32_load_system_library(const TCHAR *filename)
{ {
#ifdef CURL_WINDOWS_APP #ifdef CURL_WINDOWS_UWP
(void)filename; (void)filename;
return NULL; return NULL;
#else #else

View File

@ -149,7 +149,7 @@ enum sockmode {
ACTIVE_DISCONNECT /* as a client, disconnected from server */ ACTIVE_DISCONNECT /* as a client, disconnected from server */
}; };
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP) #if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
/* /*
* read-wrapper to support reading from stdin on Windows. * read-wrapper to support reading from stdin on Windows.
*/ */
@ -426,7 +426,7 @@ static bool read_data_block(unsigned char *buffer, ssize_t maxlen,
} }
#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_APP) #if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP)
/* /*
* Winsock select() does not support standard file descriptors, * Winsock select() does not support standard file descriptors,
* it can only check SOCKETs. The following function is an attempt * it can only check SOCKETs. The following function is an attempt

View File

@ -497,7 +497,7 @@ static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; static SIGHANDLER_T old_sigbreak_handler = SIG_ERR;
#endif #endif
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP) #if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
static DWORD thread_main_id = 0; static DWORD thread_main_id = 0;
#else #else
@ -587,7 +587,7 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType)
} }
#endif #endif
#if defined(_WIN32) && !defined(CURL_WINDOWS_APP) #if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
/* Window message handler for Windows applications to add support /* Window message handler for Windows applications to add support
* for graceful process termination via taskkill (without /f) which * for graceful process termination via taskkill (without /f) which
* sends WM_CLOSE to all Windows of a process (even hidden ones). * sends WM_CLOSE to all Windows of a process (even hidden ones).
@ -754,7 +754,7 @@ void install_signal_handlers(bool keep_sigalrm)
if(!SetConsoleCtrlHandler(ctrl_event_handler, TRUE)) if(!SetConsoleCtrlHandler(ctrl_event_handler, TRUE))
logmsg("cannot install CTRL event handler"); logmsg("cannot install CTRL event handler");
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
{ {
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
typedef HANDLE curl_win_thread_handle_t; typedef HANDLE curl_win_thread_handle_t;
@ -809,7 +809,7 @@ void restore_signal_handlers(bool keep_sigalrm)
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
(void)SetConsoleCtrlHandler(ctrl_event_handler, FALSE); (void)SetConsoleCtrlHandler(ctrl_event_handler, FALSE);
#ifndef CURL_WINDOWS_APP #ifndef CURL_WINDOWS_UWP
if(thread_main_window && thread_main_id) { if(thread_main_window && thread_main_id) {
if(PostThreadMessage(thread_main_id, WM_APP, 0, 0)) { if(PostThreadMessage(thread_main_id, WM_APP, 0, 0)) {
if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) { if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) {