config: rename the OS define to CURL_OS to reduce collision risk

Reported-by: Jon Rumsey
Fixes #15455
Closes #15457
This commit is contained in:
Daniel Stenberg 2024-10-30 14:00:16 +01:00
parent c0d2b9bee7
commit 0cececef0f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
19 changed files with 41 additions and 41 deletions

View file

@ -71,8 +71,8 @@
#define USE_MANUAL 1
#define CURL_DISABLE_LDAP 1
#ifndef OS
#define OS "AmigaOS"
#ifndef CURL_OS
#define CURL_OS "AmigaOS"
#endif
#define PACKAGE "curl"

View file

@ -29,13 +29,13 @@
/* lib/config-dos.h - Hand crafted config file for DOS */
/* ================================================================ */
#ifndef OS
#ifndef CURL_OS
#if defined(DJGPP)
#define OS "MSDOS/djgpp"
#define CURL_OS "MSDOS/djgpp"
#elif defined(__HIGHC__)
#define OS "MSDOS/HighC"
#define CURL_OS "MSDOS/HighC"
#else
#define OS "MSDOS/?"
#define CURL_OS "MSDOS/?"
#endif
#endif

View file

@ -30,8 +30,8 @@
/* On macOS you must run configure to generate curl_config.h file */
/* =================================================================== */
#ifndef OS
#define OS "mac"
#ifndef CURL_OS
#define CURL_OS "mac"
#endif
#include <ConditionalMacros.h>

View file

@ -36,8 +36,8 @@
#undef VERSION
/* Define cpu-machine-OS */
#ifndef OS
#define OS "OS/400"
#ifndef CURL_OS
#define CURL_OS "OS/400"
#endif
/* OS400 supports a 3-argument ASCII version of gethostbyaddr_r(), but its

View file

@ -32,8 +32,8 @@
#define CURL_DISABLE_LDAP 1
#define NEED_REENTRANT 1
#ifndef OS
#define OS "plan9"
#ifndef CURL_OS
#define CURL_OS "plan9"
#endif
#define PACKAGE "curl"
#define PACKAGE_NAME "curl"

View file

@ -35,8 +35,8 @@
#undef VERSION
/* Define cpu-machine-OS */
#ifndef OS
#define OS "ARM-RISC OS"
#ifndef CURL_OS
#define CURL_OS "ARM-RISC OS"
#endif
/* Define if you want the built-in manual */

View file

@ -490,19 +490,19 @@ Vista
/* ---------------------------------------------------------------- */
/* Define cpu-machine-OS */
#ifndef OS
#ifndef CURL_OS
#if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
#define OS "i386-pc-win32"
#define CURL_OS "i386-pc-win32"
#elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */
#define OS "x86_64-pc-win32"
#define CURL_OS "x86_64-pc-win32"
#elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
#define OS "ia64-pc-win32"
#define CURL_OS "ia64-pc-win32"
#elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 (Windows RT) */
#define OS "thumbv7a-pc-win32"
#define CURL_OS "thumbv7a-pc-win32"
#elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
#define OS "aarch64-pc-win32"
#define CURL_OS "aarch64-pc-win32"
#else
#define OS "unknown-pc-win32"
#define CURL_OS "unknown-pc-win32"
#endif
#endif

View file

@ -271,8 +271,8 @@
/* ---------------------------------------------------------------- */
/* Define cpu-machine-OS */
#ifndef OS
#define OS "i386-pc-win32ce"
#ifndef CURL_OS
#define CURL_OS "i386-pc-win32ce"
#endif
/* Name of package */

View file

@ -635,7 +635,7 @@
#cmakedefine NEED_REENTRANT 1
/* cpu-machine-OS */
#cmakedefine OS ${OS}
#cmakedefine CURL_OS ${CURL_OS}
/* Name of package */
#cmakedefine PACKAGE ${PACKAGE}

View file

@ -633,7 +633,7 @@ static CURLcode smb_send_setup(struct Curl_easy *data)
const size_t byte_count = sizeof(lm) + sizeof(nt) +
strlen(smbc->user) + strlen(smbc->domain) +
strlen(OS) + strlen(CLIENTNAME) + 4; /* 4 null chars */
strlen(CURL_OS) + strlen(CLIENTNAME) + 4; /* 4 null chars */
if(byte_count > sizeof(msg.bytes))
return CURLE_FILESIZE_EXCEEDED;
@ -661,7 +661,7 @@ static CURLcode smb_send_setup(struct Curl_easy *data)
"%s%c" /* domain */
"%s%c" /* OS */
"%s", /* client name */
smbc->user, 0, smbc->domain, 0, OS, 0, CLIENTNAME);
smbc->user, 0, smbc->domain, 0, CURL_OS, 0, CLIENTNAME);
p++; /* count the final null termination */
DEBUGASSERT(byte_count == (size_t)(p - msg.bytes));
msg.byte_count = smb_swap16((unsigned short)byte_count);

View file

@ -562,7 +562,7 @@ static curl_version_info_data version_info = {
CURLVERSION_NOW,
LIBCURL_VERSION,
LIBCURL_VERSION_NUM,
OS, /* as found by configure or set by hand at build-time */
CURL_OS, /* as found by configure or set by hand at build-time */
0, /* features bitmask is built at runtime */
NULL, /* ssl_version */
0, /* ssl_version_num, this is kept at zero */