From 5e70b601ee3ccdb1d53c623e89f4bde0dd2c864a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 14 Jul 2025 15:39:54 -0700 Subject: [PATCH] Subprocess: avoid some `strdup` deprecation warnings on Windows Use the POSIX compliant `_strdup` on Windows instead of `strdup` to avoid some warnings when building. --- Sources/Subprocess/Configuration.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Subprocess/Configuration.swift b/Sources/Subprocess/Configuration.swift index 5396506..ef08ca9 100644 --- a/Sources/Subprocess/Configuration.swift +++ b/Sources/Subprocess/Configuration.swift @@ -533,9 +533,17 @@ internal enum StringOrRawBytes: Sendable, Hashable { func createRawBytes() -> UnsafeMutablePointer { switch self { case .string(let string): +#if os(Windows) + return _strdup(string) +#else return strdup(string) +#endif case .rawBytes(let rawBytes): +#if os(Windows) + return _strdup(rawBytes) +#else return strdup(rawBytes) +#endif } }