]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
config: rename the OS define to CURL_OS to reduce collision risk
authorDaniel Stenberg <daniel@haxx.se>
Wed, 30 Oct 2024 13:00:16 +0000 (14:00 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Oct 2024 13:59:54 +0000 (14:59 +0100)
Reported-by: Jon Rumsey
Fixes #15455
Closes #15457

19 files changed:
.github/scripts/cmp-config.pl
CMakeLists.txt
configure.ac
lib/config-amigaos.h
lib/config-dos.h
lib/config-mac.h
lib/config-os400.h
lib/config-plan9.h
lib/config-riscos.h
lib/config-win32.h
lib/config-win32ce.h
lib/curl_config.h.cmake
lib/smb.c
lib/version.c
packages/vms/generate_config_vms_h_curl.com
src/tool_setup.h
src/tool_version.h
tests/testcurl.pl
tests/unit/unit1307.c

index cdc4f6277821573ab1301b8846e074f404a634c6..c58e3a6dfd1b267a2a7adbd5b03533817faa1791 100755 (executable)
@@ -76,8 +76,8 @@ my %remove = (
     '#define HAVE_ZSTD_H 1' => 1,
     '#define LT_OBJDIR ".libs/"' => 1,
     '#define NEED_LBER_H 1' => 1,
-    '#define OS "Linux"' => 1,
-    '#define OS "x86_64-pc-linux-gnu"' => 1,
+    '#define CURL_OS "Linux"' => 1,
+    '#define CURL_OS "x86_64-pc-linux-gnu"' => 1,
     '#define PACKAGE "curl"' => 1,
     '#define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.se/mail/"' => 1,
     '#define PACKAGE_NAME "curl"' => 1,
index dc700046d5fd66e774243ff19fcbef5615f4b687..796ce8ad624127320b0df79cd6c0908a1d5bf6ef 100644 (file)
@@ -135,9 +135,9 @@ if(CMAKE_CROSSCOMPILING)
 endif()
 
 if(CMAKE_C_COMPILER_TARGET)
-  set(OS "\"${CMAKE_C_COMPILER_TARGET}\"")
+  set(CURL_OS "\"${CMAKE_C_COMPILER_TARGET}\"")
 else()
-  set(OS "\"${CMAKE_SYSTEM_NAME}\"")
+  set(CURL_OS "\"${CMAKE_SYSTEM_NAME}\"")
 endif()
 
 include_directories("${PROJECT_SOURCE_DIR}/include")
index 163247074415d3d75bd4b4941ca711115a43155c..58ce834eda53d81d482a5a451eebe8d5c9aaf26d 100644 (file)
@@ -436,7 +436,7 @@ dnl
 
 AC_CANONICAL_HOST
 dnl Get system canonical name
-AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
+AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS])
 
 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
 AC_SUBST(AR_FLAGS, [cr])
index d168b446b6784a5582f8850d2094ee2bc275aff0..11e5999493ddc815a36cb32328479b455a72680c 100644 (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"
index c6fbba796a1a2ec6b97551b3fe08a2cb9cc5af90..4e9724726e5c236856f3ddd2778a7e1fdfcd949d 100644 (file)
 /*       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
 
index 53df87cbbc50d1208ffd6b349a7de44b17bf3e30..8d6210c77e82645b664f27e93ab6b3b54c2d986c 100644 (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>
index 29aa818fbc29e762a2d85694eff8fc79571d307a..88259d95f4be056bdfd6743b954fd4b5be9a3854 100644 (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
index 1270e108dd25749b3e8a0aadeefc28380749c332..699291a1eddb935e8f85f9c820e72232e8fc8c80 100644 (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"
index 580e822e510db74b2dd2f8c1b1981f2ec2c40e87..35b28cc5345b587b749ad14554bb3f20a8d3c3c8 100644 (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 */
index c8fdf6df09585e51a7f826b4d2b7dc12c7d3fc41..e6abf062151a7ae657812479d2677f67cd97ee2c 100644 (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
 
index 800fc61cf1ecd14f6526303cffe316ea28288fc0..80765f1f655f1cfe13c83556b897f27ba80637a0 100644 (file)
 /* ---------------------------------------------------------------- */
 
 /* Define cpu-machine-OS */
-#ifndef OS
-#define OS "i386-pc-win32ce"
+#ifndef CURL_OS
+#define CURL_OS "i386-pc-win32ce"
 #endif
 
 /* Name of package */
index 1e4b9813af148ff19593fbe15c0f557f509b67b8..32a8208b68122918ea03120ad2e87d7f4cbf3360 100644 (file)
 #cmakedefine NEED_REENTRANT 1
 
 /* cpu-machine-OS */
-#cmakedefine OS ${OS}
+#cmakedefine CURL_OS ${CURL_OS}
 
 /* Name of package */
 #cmakedefine PACKAGE ${PACKAGE}
index 2cd2deff64e116ae4f1a16458239886017367070..a242fc5c2a2857dc006b185ce92682f683cc137a 100644 (file)
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -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);
index 96bcaf29a489447cb21f56d895886acf17223815..8e1226ed70c5fb8fc247e579e80c5b86171a3871 100644 (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 */
index 623cd5fe73dc9d7c39e70eaf55f3e129c773b423..81ede597ea79b1a0bafc84d71f97bbd2cf48fa9e 100644 (file)
@@ -203,13 +203,13 @@ $! Now the DCL builds usually say xxx-HP-VMS and configure scripts
 $! may put DEC or COMPAQ or HP for the middle part.
 $!
 $write cvh "#if defined(__alpha)"
-$write cvh "#define OS ""ALPHA-HP-VMS"""
+$write cvh "#define CURL_OS ""ALPHA-HP-VMS"""
 $write cvh "#elif defined(__vax)"
-$write cvh "#define OS ""VAX-HP-VMS"""
+$write cvh "#define CURL_OS ""VAX-HP-VMS"""
 $write cvh "#elif defined(__ia64)"
-$write cvh "#define OS ""IA64-HP-VMS""
+$write cvh "#define CURL_OS ""IA64-HP-VMS""
 $write cvh "#else"
-$write cvh "#define OS ""UNKNOWN-HP-VMS""
+$write cvh "#define CURL_OS ""UNKNOWN-HP-VMS""
 $write cvh "#endif"
 $write cvh ""
 $!
index 07cba7da2e8f5cc1dafbcd8bf4f158da8f6509a2..82eb6e5a0b570765f4e8a874f80d4352a5424f8e 100644 (file)
@@ -53,8 +53,8 @@ extern FILE *tool_stderr;
 #  define main(x,y) curl_main(x,y)
 #endif
 
-#ifndef OS
-#  define OS "unknown"
+#ifndef CURL_OS
+#  define CURL_OS "unknown"
 #endif
 
 #ifndef UNPRINTABLE_CHAR
index 7ca5061814cbbeaf5ee821c462da67815316897a..00be7799ea74c67e56b73c67a7cdf00ce524273f 100644 (file)
@@ -31,6 +31,6 @@
 #define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR
 #define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR
 #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH
-#define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
+#define CURL_ID CURL_NAME " " CURL_VERSION " (" CURL_OS ") "
 
 #endif /* HEADER_CURL_TOOL_VERSION_H */
index dfb0c19769d2fa6c4fa79d07b85ca1bc5a6149af..29dd813c2ff5fb468568530020e00e6cfad04ca5 100755 (executable)
@@ -245,7 +245,7 @@ sub get_host_triplet {
 
   if(-f $configfile && -s $configfile && open(my $libconfigh, "<", "$configfile")) {
     while(<$libconfigh>) {
-      if($_ =~ /^\#define\s+OS\s+"*([^"][^"]*)"*\s*/) {
+      if($_ =~ /^\#define\s+CURL_OS\s+"*([^"][^"]*)"*\s*/) {
         $triplet = $1;
         last;
       }
index 440b3906026f2fc3eb176e03a21f393772e5c9c9..203cdd2ee3e8b093b6fad73cd76bbd192e4b6f18 100644 (file)
@@ -280,7 +280,7 @@ UNITTEST_START
   enum system machine;
 
 #ifdef HAVE_FNMATCH
-  if(strstr(OS, "apple") || strstr(OS, "darwin")) {
+  if(strstr(CURL_OS, "apple") || strstr(CURL_OS, "darwin")) {
     machine = SYSTEM_MACOS;
   }
   else