From adc69827f9c92bf867050bb04b7422a3f64efde3 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 13:28:21 -0700 Subject: [PATCH 01/19] add arch string --- source/system_info.c | 60 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/source/system_info.c b/source/system_info.c index 8c1dceada..ac0235371 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -96,21 +96,65 @@ AWS_STATIC_STRING_FROM_LITERAL(s_android_str, "Android"); AWS_STATIC_STRING_FROM_LITERAL(s_unix_str, "Unix"); AWS_STATIC_STRING_FROM_LITERAL(s_unknown_str, "Unknown"); +AWS_STATIC_STRING_FROM_LITERAL(s_intel, "intel"); +AWS_STATIC_STRING_FROM_LITERAL(s_intel_64, "intel_64"); +AWS_STATIC_STRING_FROM_LITERAL(s_arm64, "arm64"); +AWS_STATIC_STRING_FROM_LITERAL(s_arm32, "arm32"); + +static uint8_t s_platform_string_buffer[32]; +static struct aws_byte_buf s_platform_buf = { + .buffer = s_platform_string_buffer, + .capacity = sizeof(s_platform_string_buffer), + .len = 0, + .allocator = NULL +}; + struct aws_byte_cursor aws_get_platform_build_os_string(void) { + if (s_platform_buf.len != 0) { + return aws_byte_cursor_from_buf(&s_platform_buf); + } + enum aws_platform_os os = aws_get_platform_build_os(); + struct aws_byte_cursor os_str; + struct aws_byte_cursor arch_str; + switch (os) { case AWS_PLATFORM_OS_WINDOWS: - return aws_byte_cursor_from_string(s_windows_str); + os_str = aws_byte_cursor_from_string(s_windows_str); + break; case AWS_PLATFORM_OS_MAC: - return aws_byte_cursor_from_string(s_macos_str); + os_str = aws_byte_cursor_from_string(s_macos_str); + break; case AWS_PLATFORM_OS_IOS: - return aws_byte_cursor_from_string(s_ios_str); + os_str = aws_byte_cursor_from_string(s_ios_str); + break; case AWS_PLATFORM_OS_ANDROID: - return aws_byte_cursor_from_string(s_android_str); + os_str = aws_byte_cursor_from_string(s_android_str); + break; case AWS_PLATFORM_OS_UNIX: - return aws_byte_cursor_from_string(s_unix_str); + os_str = aws_byte_cursor_from_string(s_unix_str); + break; + default: + AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform OS enum value: %d", (int)os); + os_str = aws_byte_cursor_from_string(s_unknown_str); } - /* Handle invalid enum values */ - AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform OS enum value: %d", (int)os); - return aws_byte_cursor_from_string(s_unknown_str); + +#ifdef AWS_ARCH_INTEL + arch_str = aws_byte_cursor_from_string(s_intel); +#elif defined(AWS_ARCH_INTEL_64) + arch_str = aws_byte_cursor_from_string(s_intel_64); +#elif defined(AWS_ARCH_ARM64) + arch_str = aws_byte_cursor_from_string(s_arm64); +#elif defined(AWS_ARCH_ARM32) + arch_str = aws_byte_cursor_from_string(s_arm32); +#else + arch_str = aws_byte_cursor_from_c_str("unknown"); +#endif + + aws_byte_buf_reset(&s_platform_buf, false); + aws_byte_buf_append(&s_platform_buf, &os_str); + aws_byte_buf_append(&s_platform_buf, "-"); + aws_byte_buf_append(&s_platform_buf, &arch_str); + + return aws_byte_cursor_from_buf(&s_platform_buf); } From 4a08bff45b4cab85e6a596b0376fc1a074fb5131 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:11:22 -0700 Subject: [PATCH 02/19] append - --- source/system_info.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/system_info.c b/source/system_info.c index ac0235371..220772dca 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -149,11 +149,13 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { arch_str = aws_byte_cursor_from_string(s_arm32); #else arch_str = aws_byte_cursor_from_c_str("unknown"); + AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform architecture."); #endif aws_byte_buf_reset(&s_platform_buf, false); aws_byte_buf_append(&s_platform_buf, &os_str); - aws_byte_buf_append(&s_platform_buf, "-"); + const struct aws_byte_cursor s_dash = aws_byte_cursor_from_c_str("_"); + aws_byte_buf_append(&s_platform_buf, &s_dash); aws_byte_buf_append(&s_platform_buf, &arch_str); return aws_byte_cursor_from_buf(&s_platform_buf); From 5d4a251ff60f70cb71bf583c335b5c2d40d0442f Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:17:16 -0700 Subject: [PATCH 03/19] remove static string --- source/system_info.c | 47 +++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/source/system_info.c b/source/system_info.c index 220772dca..b7c9d756c 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -89,69 +89,54 @@ size_t aws_system_environment_get_cpu_group_count(const struct aws_system_enviro * - "Unix" - Unix-like systems (Linux, BSD, etc.) * - "Unknown" - Fallback for unrecognized platforms */ -AWS_STATIC_STRING_FROM_LITERAL(s_windows_str, "Windows"); -AWS_STATIC_STRING_FROM_LITERAL(s_macos_str, "macOS"); -AWS_STATIC_STRING_FROM_LITERAL(s_ios_str, "iOS"); -AWS_STATIC_STRING_FROM_LITERAL(s_android_str, "Android"); -AWS_STATIC_STRING_FROM_LITERAL(s_unix_str, "Unix"); -AWS_STATIC_STRING_FROM_LITERAL(s_unknown_str, "Unknown"); - -AWS_STATIC_STRING_FROM_LITERAL(s_intel, "intel"); -AWS_STATIC_STRING_FROM_LITERAL(s_intel_64, "intel_64"); -AWS_STATIC_STRING_FROM_LITERAL(s_arm64, "arm64"); -AWS_STATIC_STRING_FROM_LITERAL(s_arm32, "arm32"); static uint8_t s_platform_string_buffer[32]; -static struct aws_byte_buf s_platform_buf = { - .buffer = s_platform_string_buffer, - .capacity = sizeof(s_platform_string_buffer), - .len = 0, - .allocator = NULL -}; +static struct aws_byte_buf s_platform_buf = + {.buffer = s_platform_string_buffer, .capacity = sizeof(s_platform_string_buffer), .len = 0, .allocator = NULL}; struct aws_byte_cursor aws_get_platform_build_os_string(void) { if (s_platform_buf.len != 0) { return aws_byte_cursor_from_buf(&s_platform_buf); } - + enum aws_platform_os os = aws_get_platform_build_os(); struct aws_byte_cursor os_str; struct aws_byte_cursor arch_str; - + switch (os) { case AWS_PLATFORM_OS_WINDOWS: - os_str = aws_byte_cursor_from_string(s_windows_str); + os_str = aws_byte_cursor_from_c_str("Windows"); break; case AWS_PLATFORM_OS_MAC: - os_str = aws_byte_cursor_from_string(s_macos_str); + os_str = aws_byte_cursor_from_c_str("macOS"); break; case AWS_PLATFORM_OS_IOS: - os_str = aws_byte_cursor_from_string(s_ios_str); + os_str = aws_byte_cursor_from_c_str("iOS"); break; case AWS_PLATFORM_OS_ANDROID: - os_str = aws_byte_cursor_from_string(s_android_str); + os_str = aws_byte_cursor_from_c_str("Android"); break; case AWS_PLATFORM_OS_UNIX: - os_str = aws_byte_cursor_from_string(s_unix_str); + os_str = aws_byte_cursor_from_c_str("Linux"); break; default: + os_str = aws_byte_cursor_from_string("unknown"); AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform OS enum value: %d", (int)os); - os_str = aws_byte_cursor_from_string(s_unknown_str); } - + #ifdef AWS_ARCH_INTEL - arch_str = aws_byte_cursor_from_string(s_intel); + arch_str = aws_byte_cursor_from_c_str("intel"); #elif defined(AWS_ARCH_INTEL_64) - arch_str = aws_byte_cursor_from_string(s_intel_64); + arch_str = aws_byte_cursor_from_c_str("intel64"); #elif defined(AWS_ARCH_ARM64) - arch_str = aws_byte_cursor_from_string(s_arm64); + arch_str = aws_byte_cursor_from_c_str("arm64"); #elif defined(AWS_ARCH_ARM32) - arch_str = aws_byte_cursor_from_string(s_arm32); + arch_str = aws_byte_cursor_from_c_str("arm32"); #else arch_str = aws_byte_cursor_from_c_str("unknown"); AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform architecture."); #endif - + aws_byte_buf_reset(&s_platform_buf, false); aws_byte_buf_append(&s_platform_buf, &os_str); const struct aws_byte_cursor s_dash = aws_byte_cursor_from_c_str("_"); From e3a696f0d06bf8431d553dd91be9148244cfc96c Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:19:12 -0700 Subject: [PATCH 04/19] use const char* --- source/system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/system_info.c b/source/system_info.c index b7c9d756c..e2a19ef60 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -120,7 +120,7 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { os_str = aws_byte_cursor_from_c_str("Linux"); break; default: - os_str = aws_byte_cursor_from_string("unknown"); + os_str = aws_byte_cursor_from_c_str("unknown"); AWS_LOGF_WARN(AWS_LS_COMMON_GENERAL, "Unknown platform OS enum value: %d", (int)os); } From 1a2c3c76052717176cfa9ab5efcf087901ee4d1a Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:23:25 -0700 Subject: [PATCH 05/19] fix test --- tests/system_info_tests.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index a87e93468..d9d54f89d 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -142,15 +142,15 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v ASSERT_TRUE(os_string.len > 0); #if defined(AWS_OS_MACOS) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "macOS")); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "macOS")); #elif defined(AWS_OS_APPLE) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "iOS")); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "iOS")); #elif defined(AWS_OS_ANDROID) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "Android")); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Android")); #elif defined(_WIN32) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "Windows")); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Windows")); #else - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "Unix")); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Unix")); #endif return 0; From 58b33df243bff02f5599697dbea82f17507d5d68 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:44:48 -0700 Subject: [PATCH 06/19] update test to use start_with --- tests/system_info_tests.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index d9d54f89d..ca5692175 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -141,17 +141,18 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v ASSERT_TRUE(aws_byte_cursor_is_valid(&os_string)); ASSERT_TRUE(os_string.len > 0); + const struct aws_byte_cursor platform_str = aws_byte_cursor_from_c_str("macOS"); #if defined(AWS_OS_MACOS) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "macOS")); #elif defined(AWS_OS_APPLE) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "iOS")); + platform_str = aws_byte_cursor_from_c_str("iOS"); #elif defined(AWS_OS_ANDROID) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Android")); + platform_str = aws_byte_cursor_from_c_str("Android"); #elif defined(_WIN32) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Windows")); + platform_str = aws_byte_cursor_from_c_str("Windows"); #else - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, "Unix")); + platform_str = aws_byte_cursor_from_c_str("Unix"); #endif + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &platform_str)); return 0; } From 122843e5a640e86b995d4c7a40497b2effa902ed Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:48:17 -0700 Subject: [PATCH 07/19] fix variable type --- tests/system_info_tests.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index ca5692175..7848f6786 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -141,16 +141,16 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v ASSERT_TRUE(aws_byte_cursor_is_valid(&os_string)); ASSERT_TRUE(os_string.len > 0); - const struct aws_byte_cursor platform_str = aws_byte_cursor_from_c_str("macOS"); + struct aws_byte_cursor platform_str = aws_byte_cursor_from_c_str("macOS"); #if defined(AWS_OS_MACOS) #elif defined(AWS_OS_APPLE) - platform_str = aws_byte_cursor_from_c_str("iOS"); + platform_str = aws_byte_cursor_from_c_str("iOS"); #elif defined(AWS_OS_ANDROID) - platform_str = aws_byte_cursor_from_c_str("Android"); + platform_str = aws_byte_cursor_from_c_str("Android"); #elif defined(_WIN32) - platform_str = aws_byte_cursor_from_c_str("Windows"); + platform_str = aws_byte_cursor_from_c_str("Windows"); #else - platform_str = aws_byte_cursor_from_c_str("Unix"); + platform_str = aws_byte_cursor_from_c_str("Unix"); #endif ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &platform_str)); From 2da7e8eec1c7a837d51460f762bc92f6412f865e Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 31 Oct 2025 14:50:57 -0700 Subject: [PATCH 08/19] fix unix platform name --- source/system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/system_info.c b/source/system_info.c index e2a19ef60..f0c88353a 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -117,7 +117,7 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { os_str = aws_byte_cursor_from_c_str("Android"); break; case AWS_PLATFORM_OS_UNIX: - os_str = aws_byte_cursor_from_c_str("Linux"); + os_str = aws_byte_cursor_from_c_str("Unix"); break; default: os_str = aws_byte_cursor_from_c_str("unknown"); From 42d7a18016ab62502e01ddcf669e6d22d71d62b8 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 3 Nov 2025 09:17:49 -0800 Subject: [PATCH 09/19] update unit test for systeminfo --- source/system_info.c | 2 +- tests/system_info_tests.c | 33 +++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/source/system_info.c b/source/system_info.c index f0c88353a..6f920ff8c 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -139,7 +139,7 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { aws_byte_buf_reset(&s_platform_buf, false); aws_byte_buf_append(&s_platform_buf, &os_str); - const struct aws_byte_cursor s_dash = aws_byte_cursor_from_c_str("_"); + const struct aws_byte_cursor s_dash = aws_byte_cursor_from_c_str("-"); aws_byte_buf_append(&s_platform_buf, &s_dash); aws_byte_buf_append(&s_platform_buf, &arch_str); diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 7848f6786..5dd199e8a 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -141,18 +141,39 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v ASSERT_TRUE(aws_byte_cursor_is_valid(&os_string)); ASSERT_TRUE(os_string.len > 0); - struct aws_byte_cursor platform_str = aws_byte_cursor_from_c_str("macOS"); + /* Verify OS-ARCH format */ + struct aws_byte_cursor dash = aws_byte_cursor_from_c_str("-"); + struct aws_byte_cursor found_dash; + ASSERT_SUCCESS(aws_byte_cursor_find_exact(&os_string, &dash, &found_dash)); + + /* Verify OS part */ #if defined(AWS_OS_MACOS) + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("macOS-"))); #elif defined(AWS_OS_APPLE) - platform_str = aws_byte_cursor_from_c_str("iOS"); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("iOS-"))); #elif defined(AWS_OS_ANDROID) - platform_str = aws_byte_cursor_from_c_str("Android"); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Android-"))); #elif defined(_WIN32) - platform_str = aws_byte_cursor_from_c_str("Windows"); + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Windows-"))); +#else + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Unix-"))); +#endif + + /* Verify architecture part exists after dash */ + size_t dash_pos = found_dash.ptr - os_string.ptr; + struct aws_byte_cursor arch_part = aws_byte_cursor_advance(&os_string, dash_pos + 1); + +#if defined(AWS_ARCH_INTEL) + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "intel")); +#elif defined(AWS_ARCH_INTEL_64) + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "intel_64")); +#elif defined(AWS_ARCH_ARM64) + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "arm64")); +#elif defined(AWS_ARCH_ARM32) + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "arm32")); #else - platform_str = aws_byte_cursor_from_c_str("Unix"); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "unknown")); #endif - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &platform_str)); return 0; } From ec873d845ec8bc5961b523380da3d4b08d4823d4 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 3 Nov 2025 09:29:50 -0800 Subject: [PATCH 10/19] fix systeminfo test --- tests/system_info_tests.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 5dd199e8a..2f5eeb9e1 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -146,33 +146,36 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v struct aws_byte_cursor found_dash; ASSERT_SUCCESS(aws_byte_cursor_find_exact(&os_string, &dash, &found_dash)); + struct aws_byte_cursor expected_os = aws_byte_cursor_from_c_str("Unknown-"); + /* Verify OS part */ #if defined(AWS_OS_MACOS) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("macOS-"))); + expected_os = aws_byte_cursor_from_c_str("macOS-"); #elif defined(AWS_OS_APPLE) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("iOS-"))); + expected_os = aws_byte_cursor_from_c_str("iOS-"); #elif defined(AWS_OS_ANDROID) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Android-"))); + expected_os = aws_byte_cursor_from_c_str("Android-"); #elif defined(_WIN32) - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Windows-"))); -#else - ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &aws_byte_cursor_from_c_str("Unix-"))); + expected_os = aws_byte_cursor_from_c_str("Windows-"); +#else defined(_UNIX) + expected_os = aws_byte_cursor_from_c_str("Unix-"); #endif + ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &expected_os)); /* Verify architecture part exists after dash */ size_t dash_pos = found_dash.ptr - os_string.ptr; - struct aws_byte_cursor arch_part = aws_byte_cursor_advance(&os_string, dash_pos + 1); + aws_byte_cursor_advance(&os_string, dash_pos + 1); #if defined(AWS_ARCH_INTEL) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "intel")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel")); #elif defined(AWS_ARCH_INTEL_64) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "intel_64")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel_64")); #elif defined(AWS_ARCH_ARM64) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "arm64")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "arm64")); #elif defined(AWS_ARCH_ARM32) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "arm32")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "arm32")); #else - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&arch_part, "unknown")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "unknown")); #endif return 0; From 32af8b385fc9fafcbe3812289a274a01b8935e2d Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 3 Nov 2025 10:24:14 -0800 Subject: [PATCH 11/19] fix on unix --- tests/system_info_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 2f5eeb9e1..71e7221a8 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -157,7 +157,7 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v expected_os = aws_byte_cursor_from_c_str("Android-"); #elif defined(_WIN32) expected_os = aws_byte_cursor_from_c_str("Windows-"); -#else defined(_UNIX) +#elif defined(_UNIX) expected_os = aws_byte_cursor_from_c_str("Unix-"); #endif ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &expected_os)); From 6581afaefe2c629624c6f57781bf85e81193b666 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 3 Nov 2025 10:46:19 -0800 Subject: [PATCH 12/19] use proper unix os detection --- tests/system_info_tests.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 71e7221a8..5c3164da6 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -151,13 +151,13 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v /* Verify OS part */ #if defined(AWS_OS_MACOS) expected_os = aws_byte_cursor_from_c_str("macOS-"); -#elif defined(AWS_OS_APPLE) +#elif defined(AWS_OS_IOS) expected_os = aws_byte_cursor_from_c_str("iOS-"); #elif defined(AWS_OS_ANDROID) expected_os = aws_byte_cursor_from_c_str("Android-"); -#elif defined(_WIN32) +#elif defined(AWS_OS_WINDOWS) expected_os = aws_byte_cursor_from_c_str("Windows-"); -#elif defined(_UNIX) +#else expected_os = aws_byte_cursor_from_c_str("Unix-"); #endif ASSERT_TRUE(aws_byte_cursor_starts_with(&os_string, &expected_os)); From 1037b22b82fdccc7e1e8c786a434629ad1cef8c0 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Mon, 3 Nov 2025 13:21:03 -0800 Subject: [PATCH 13/19] add tvos and watchos --- include/aws/common/system_info.h | 15 +++++++++------ source/posix/system_info.c | 6 +++++- source/system_info.c | 5 +++++ tests/system_info_tests.c | 10 +++++++++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index ebe8bd67d..ecb35bb92 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -15,17 +15,20 @@ AWS_PUSH_SANE_WARNING_LEVEL * Platform OS enumeration and their corresponding string representations. * * String mappings: - * - AWS_PLATFORM_OS_WINDOWS → "Windows" (Microsoft Windows family) - * - AWS_PLATFORM_OS_MAC → "macOS" (Apple desktop/laptop) - * - AWS_PLATFORM_OS_IOS → "iOS" (Apple mobile platforms, covers iOS, watchOS, tvOS, - * and other non-macOS Apple platforms) - * - AWS_PLATFORM_OS_ANDROID → "Android" (Google Android) - * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, BSD, other Unix-like) + * - AWS_PLATFORM_OS_WINDOWS → "Windows" (Microsoft Windows family) + * - AWS_PLATFORM_OS_MAC → "macOS" (Apple desktop/laptop) + * - AWS_PLATFORM_OS_IOS → "iOS" (Apple mobile devices) + * - AWS_PLATFORM_OS_TVOS → "tvOS" (Apple TV devices) + * - AWS_PLATFORM_OS_WATCHOS → "watchOS" (Apple Watch devices) + * - AWS_PLATFORM_OS_ANDROID → "Android" (Android) + * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, BSD, other Unix-like) */ enum aws_platform_os { AWS_PLATFORM_OS_WINDOWS, AWS_PLATFORM_OS_MAC, AWS_PLATFORM_OS_IOS, + AWS_PLATFORM_OS_TVOS, + AWS_PLATFORM_OS_WATCHOS, AWS_PLATFORM_OS_ANDROID, AWS_PLATFORM_OS_UNIX, }; diff --git a/source/posix/system_info.c b/source/posix/system_info.c index 2d957f734..ca4760aa8 100644 --- a/source/posix/system_info.c +++ b/source/posix/system_info.c @@ -469,8 +469,12 @@ enum aws_platform_os aws_get_platform_build_os(void) { #if defined(AWS_OS_MACOS) return AWS_PLATFORM_OS_MAC; // Other Apple platforms will be reported as iOS -#elif defined(AWS_OS_APPLE) +#elif defined(AWS_OS_IOS) return AWS_PLATFORM_OS_IOS; +#elif defined(AWS_OS_TVOS) + return AWS_PLATFORM_OS_TVOS; +#elif defined(AWS_OS_WATCHOS) + return AWS_PLATFORM_OS_WATCHOS; #elif defined(AWS_OS_ANDROID) return AWS_PLATFORM_OS_ANDROID; #else diff --git a/source/system_info.c b/source/system_info.c index 6f920ff8c..a21714c87 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -113,6 +113,11 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { case AWS_PLATFORM_OS_IOS: os_str = aws_byte_cursor_from_c_str("iOS"); break; + case AWS_PLATFORM_OS_TVOS: + os_str = aws_byte_cursor_from_c_str("tvOS"); + break; + case AWS_PLATFORM_OS_WATCHOS: + os_str = aws_byte_cursor_from_c_str("watchOS"); case AWS_PLATFORM_OS_ANDROID: os_str = aws_byte_cursor_from_c_str("Android"); break; diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 5c3164da6..794b03748 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -118,8 +118,12 @@ static int s_test_platform_build_os_fn(struct aws_allocator *allocator, void *ct #if defined(AWS_OS_MACOS) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_MAC); -#elif defined(AWS_OS_APPLE) +#elif defined(AWS_OS_IOS) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_IOS); +#elif defined(AWS_OS_TVOS) + ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_TVOS); +#elif defined(AWS_OS_WATCHOS) + ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_WATCHOS); #elif defined(AWS_OS_ANDROID) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_ANDROID); #elif defined(_WIN32) @@ -153,6 +157,10 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v expected_os = aws_byte_cursor_from_c_str("macOS-"); #elif defined(AWS_OS_IOS) expected_os = aws_byte_cursor_from_c_str("iOS-"); +#elif defined(AWS_OS_TVOS) + expected_os = aws_byte_cursor_from_c_str("tvOS-"); +#elif defined(AWS_OS_WATCHOS) + expected_os = aws_byte_cursor_from_c_str("watchOS-"); #elif defined(AWS_OS_ANDROID) expected_os = aws_byte_cursor_from_c_str("Android-"); #elif defined(AWS_OS_WINDOWS) From fa4e686610fe312b691564c0f4bbb19cb697a637 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 4 Nov 2025 14:28:05 -0800 Subject: [PATCH 14/19] add bsd --- include/aws/common/platform.h | 4 ++++ include/aws/common/system_info.h | 4 +++- source/posix/system_info.c | 3 ++- source/system_info.c | 11 +++++++++-- tests/system_info_tests.c | 6 +++++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/include/aws/common/platform.h b/include/aws/common/platform.h index 9742860fb..d3678022f 100644 --- a/include/aws/common/platform.h +++ b/include/aws/common/platform.h @@ -31,6 +31,10 @@ # define AWS_OS_LINUX #endif +#if defined(__FreeBSD__) || defined(__NetBSD__) +# define AWS_OS_BSD +#endif + #if defined(__ANDROID__) # define AWS_OS_ANDROID #endif diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index ecb35bb92..91823bc1d 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -21,7 +21,8 @@ AWS_PUSH_SANE_WARNING_LEVEL * - AWS_PLATFORM_OS_TVOS → "tvOS" (Apple TV devices) * - AWS_PLATFORM_OS_WATCHOS → "watchOS" (Apple Watch devices) * - AWS_PLATFORM_OS_ANDROID → "Android" (Android) - * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, BSD, other Unix-like) + * - AWS_PLATFORM_OS_BSD → "BSD" (FreeBSD, NetBSD) + * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, other Unix-like) */ enum aws_platform_os { AWS_PLATFORM_OS_WINDOWS, @@ -30,6 +31,7 @@ enum aws_platform_os { AWS_PLATFORM_OS_TVOS, AWS_PLATFORM_OS_WATCHOS, AWS_PLATFORM_OS_ANDROID, + AWS_PLATFORM_OS_BSD, AWS_PLATFORM_OS_UNIX, }; diff --git a/source/posix/system_info.c b/source/posix/system_info.c index ca4760aa8..da08f0308 100644 --- a/source/posix/system_info.c +++ b/source/posix/system_info.c @@ -468,7 +468,6 @@ void aws_backtrace_log(int log_level) { enum aws_platform_os aws_get_platform_build_os(void) { #if defined(AWS_OS_MACOS) return AWS_PLATFORM_OS_MAC; -// Other Apple platforms will be reported as iOS #elif defined(AWS_OS_IOS) return AWS_PLATFORM_OS_IOS; #elif defined(AWS_OS_TVOS) @@ -477,6 +476,8 @@ enum aws_platform_os aws_get_platform_build_os(void) { return AWS_PLATFORM_OS_WATCHOS; #elif defined(AWS_OS_ANDROID) return AWS_PLATFORM_OS_ANDROID; +#elif defined(AWS_OS_BSD) + return AWS_PLATFORM_OS_BSD; #else return AWS_PLATFORM_OS_UNIX; #endif diff --git a/source/system_info.c b/source/system_info.c index a21714c87..69ab3af44 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -84,9 +84,12 @@ size_t aws_system_environment_get_cpu_group_count(const struct aws_system_enviro * follow common industry conventions: * - "Windows" - Microsoft Windows family * - "macOS" - Apple macOS - * - "iOS" - Apple iOS (or other unknown Apple platform) + * - "iOS" - Apple iOS + * - "tvOS" - Apple tvOS + * - "watchOS" - Apple watchOS * - "Android" - Google Android mobile OS - * - "Unix" - Unix-like systems (Linux, BSD, etc.) + * - "BSD" - BSD family (FreeBSD, NetBSD, etc.) + * - "Unix" - Unix-like systems (Linux, unix-like etc.) * - "Unknown" - Fallback for unrecognized platforms */ @@ -118,9 +121,13 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { break; case AWS_PLATFORM_OS_WATCHOS: os_str = aws_byte_cursor_from_c_str("watchOS"); + break; case AWS_PLATFORM_OS_ANDROID: os_str = aws_byte_cursor_from_c_str("Android"); break; + case AWS_PLATFORM_OS_BSD: + os_str = aws_byte_cursor_from_c_str("BSD"); + break; case AWS_PLATFORM_OS_UNIX: os_str = aws_byte_cursor_from_c_str("Unix"); break; diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 794b03748..3eb53dfed 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -128,6 +128,8 @@ static int s_test_platform_build_os_fn(struct aws_allocator *allocator, void *ct ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_ANDROID); #elif defined(_WIN32) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_WINDOWS); +#elif defined(AWS_OS_BSD) + ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_BSD); #else ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_UNIX); #endif @@ -165,6 +167,8 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v expected_os = aws_byte_cursor_from_c_str("Android-"); #elif defined(AWS_OS_WINDOWS) expected_os = aws_byte_cursor_from_c_str("Windows-"); +#elif defined(AWS_OS_BSD) + expected_os = aws_byte_cursor_from_c_str("BSD-"); #else expected_os = aws_byte_cursor_from_c_str("Unix-"); #endif @@ -177,7 +181,7 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v #if defined(AWS_ARCH_INTEL) ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel")); #elif defined(AWS_ARCH_INTEL_64) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel_64")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel64")); #elif defined(AWS_ARCH_ARM64) ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "arm64")); #elif defined(AWS_ARCH_ARM32) From 283f9ffc89019ea11fda72aeb3d4cf480ea936c6 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 4 Nov 2025 14:30:28 -0800 Subject: [PATCH 15/19] add openbsd --- include/aws/common/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/aws/common/platform.h b/include/aws/common/platform.h index d3678022f..d40b36bc5 100644 --- a/include/aws/common/platform.h +++ b/include/aws/common/platform.h @@ -31,7 +31,7 @@ # define AWS_OS_LINUX #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define AWS_OS_BSD #endif From 876ae7254a152147e74dbade94dc751d149b93c6 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 4 Nov 2025 14:53:07 -0800 Subject: [PATCH 16/19] update comments --- include/aws/common/system_info.h | 24 ++++++++++++++++++++++-- source/system_info.c | 14 -------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index 91823bc1d..904bfdde5 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -21,7 +21,7 @@ AWS_PUSH_SANE_WARNING_LEVEL * - AWS_PLATFORM_OS_TVOS → "tvOS" (Apple TV devices) * - AWS_PLATFORM_OS_WATCHOS → "watchOS" (Apple Watch devices) * - AWS_PLATFORM_OS_ANDROID → "Android" (Android) - * - AWS_PLATFORM_OS_BSD → "BSD" (FreeBSD, NetBSD) + * - AWS_PLATFORM_OS_BSD → "BSD" (FreeBSD, NetBSD, openBSD) * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, other Unix-like) */ enum aws_platform_os { @@ -92,7 +92,27 @@ size_t aws_system_environment_get_cpu_group_count(const struct aws_system_enviro AWS_COMMON_API enum aws_platform_os aws_get_platform_build_os(void); -/* Returns the OS this was built under as a string */ +/* Returns the OS and architecture this was built under as a string, with format - + * + * Platform OS string constants - these are the string representations for each supported platform. String choices + * follow common industry conventions: + * - "Windows" - Microsoft Windows family + * - "macOS" - Apple macOS + * - "iOS" - Apple iOS + * - "tvOS" - Apple tvOS + * - "watchOS" - Apple watchOS + * - "Android" - Google Android mobile OS + * - "BSD" - BSD family (FreeBSD, NetBSD, OpenBSD) + * - "Unix" - Unix-like systems (Linux, unix-like etc.) + * - "Unknown" - Fallback for unrecognized platforms + * + * Architecture string constants: + * - "intel" - 32-bit Intel x86 architecture + * - "intel64" - 64-bit Intel x86_64 architecture + * - "arm32" - 32-bit ARM architecture + * - "arm64" - 64-bit ARM architecture + * - "unknown" - Fallback for unrecognized architectures + */ AWS_COMMON_API struct aws_byte_cursor aws_get_platform_build_os_string(void); diff --git a/source/system_info.c b/source/system_info.c index 69ab3af44..cf93df59a 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -79,20 +79,6 @@ size_t aws_system_environment_get_cpu_group_count(const struct aws_system_enviro return env->cpu_group_count; } -/* - * Platform OS string constants - these are the string representations for each supported platform. String choices - * follow common industry conventions: - * - "Windows" - Microsoft Windows family - * - "macOS" - Apple macOS - * - "iOS" - Apple iOS - * - "tvOS" - Apple tvOS - * - "watchOS" - Apple watchOS - * - "Android" - Google Android mobile OS - * - "BSD" - BSD family (FreeBSD, NetBSD, etc.) - * - "Unix" - Unix-like systems (Linux, unix-like etc.) - * - "Unknown" - Fallback for unrecognized platforms - */ - static uint8_t s_platform_string_buffer[32]; static struct aws_byte_buf s_platform_buf = {.buffer = s_platform_string_buffer, .capacity = sizeof(s_platform_string_buffer), .len = 0, .allocator = NULL}; From ed2c93a765da4f35a6a05acb49f8fe8597f2a26c Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 4 Nov 2025 14:58:06 -0800 Subject: [PATCH 17/19] lint --- include/aws/common/system_info.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index 904bfdde5..87edda75b 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -93,9 +93,9 @@ AWS_COMMON_API enum aws_platform_os aws_get_platform_build_os(void); /* Returns the OS and architecture this was built under as a string, with format - - * - * Platform OS string constants - these are the string representations for each supported platform. String choices - * follow common industry conventions: + * + * Platform OS string constants - these are the string representations for each supported platform. + * String choices follow common industry conventions: * - "Windows" - Microsoft Windows family * - "macOS" - Apple macOS * - "iOS" - Apple iOS From 0bf2ef641a892c2a942d5a4b9f69638292bf2cd6 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Wed, 5 Nov 2025 09:43:36 -0800 Subject: [PATCH 18/19] use x86 for intel x86 --- include/aws/common/system_info.h | 4 ++-- source/system_info.c | 4 ++-- tests/system_info_tests.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index 87edda75b..cc6a397fa 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -107,8 +107,8 @@ enum aws_platform_os aws_get_platform_build_os(void); * - "Unknown" - Fallback for unrecognized platforms * * Architecture string constants: - * - "intel" - 32-bit Intel x86 architecture - * - "intel64" - 64-bit Intel x86_64 architecture + * - "x86_32" - 32-bit Intel x86 architecture + * - "x86_64" - 64-bit Intel x86_64 architecture * - "arm32" - 32-bit ARM architecture * - "arm64" - 64-bit ARM architecture * - "unknown" - Fallback for unrecognized architectures diff --git a/source/system_info.c b/source/system_info.c index cf93df59a..0dce3e5d0 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -123,9 +123,9 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { } #ifdef AWS_ARCH_INTEL - arch_str = aws_byte_cursor_from_c_str("intel"); + arch_str = aws_byte_cursor_from_c_str("x86_32"); #elif defined(AWS_ARCH_INTEL_64) - arch_str = aws_byte_cursor_from_c_str("intel64"); + arch_str = aws_byte_cursor_from_c_str("x86_64"); #elif defined(AWS_ARCH_ARM64) arch_str = aws_byte_cursor_from_c_str("arm64"); #elif defined(AWS_ARCH_ARM32) diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index 3eb53dfed..c4189dbdc 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -179,9 +179,9 @@ static int s_test_platform_build_os_string_fn(struct aws_allocator *allocator, v aws_byte_cursor_advance(&os_string, dash_pos + 1); #if defined(AWS_ARCH_INTEL) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "x86_32")); #elif defined(AWS_ARCH_INTEL_64) - ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "intel64")); + ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "x86_64")); #elif defined(AWS_ARCH_ARM64) ASSERT_TRUE(aws_byte_cursor_eq_c_str(&os_string, "arm64")); #elif defined(AWS_ARCH_ARM32) From 364c317f2fa8665f3fc19327241f83466779959b Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Wed, 5 Nov 2025 10:11:52 -0800 Subject: [PATCH 19/19] remove watchOS as it is not supported yet --- include/aws/common/system_info.h | 2 -- source/posix/system_info.c | 2 -- source/system_info.c | 3 --- tests/system_info_tests.c | 2 -- 4 files changed, 9 deletions(-) diff --git a/include/aws/common/system_info.h b/include/aws/common/system_info.h index cc6a397fa..0c65a3629 100644 --- a/include/aws/common/system_info.h +++ b/include/aws/common/system_info.h @@ -19,7 +19,6 @@ AWS_PUSH_SANE_WARNING_LEVEL * - AWS_PLATFORM_OS_MAC → "macOS" (Apple desktop/laptop) * - AWS_PLATFORM_OS_IOS → "iOS" (Apple mobile devices) * - AWS_PLATFORM_OS_TVOS → "tvOS" (Apple TV devices) - * - AWS_PLATFORM_OS_WATCHOS → "watchOS" (Apple Watch devices) * - AWS_PLATFORM_OS_ANDROID → "Android" (Android) * - AWS_PLATFORM_OS_BSD → "BSD" (FreeBSD, NetBSD, openBSD) * - AWS_PLATFORM_OS_UNIX → "Unix" (Linux, other Unix-like) @@ -29,7 +28,6 @@ enum aws_platform_os { AWS_PLATFORM_OS_MAC, AWS_PLATFORM_OS_IOS, AWS_PLATFORM_OS_TVOS, - AWS_PLATFORM_OS_WATCHOS, AWS_PLATFORM_OS_ANDROID, AWS_PLATFORM_OS_BSD, AWS_PLATFORM_OS_UNIX, diff --git a/source/posix/system_info.c b/source/posix/system_info.c index da08f0308..eefde298b 100644 --- a/source/posix/system_info.c +++ b/source/posix/system_info.c @@ -472,8 +472,6 @@ enum aws_platform_os aws_get_platform_build_os(void) { return AWS_PLATFORM_OS_IOS; #elif defined(AWS_OS_TVOS) return AWS_PLATFORM_OS_TVOS; -#elif defined(AWS_OS_WATCHOS) - return AWS_PLATFORM_OS_WATCHOS; #elif defined(AWS_OS_ANDROID) return AWS_PLATFORM_OS_ANDROID; #elif defined(AWS_OS_BSD) diff --git a/source/system_info.c b/source/system_info.c index 0dce3e5d0..3e328cd92 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -105,9 +105,6 @@ struct aws_byte_cursor aws_get_platform_build_os_string(void) { case AWS_PLATFORM_OS_TVOS: os_str = aws_byte_cursor_from_c_str("tvOS"); break; - case AWS_PLATFORM_OS_WATCHOS: - os_str = aws_byte_cursor_from_c_str("watchOS"); - break; case AWS_PLATFORM_OS_ANDROID: os_str = aws_byte_cursor_from_c_str("Android"); break; diff --git a/tests/system_info_tests.c b/tests/system_info_tests.c index c4189dbdc..d15cd869f 100644 --- a/tests/system_info_tests.c +++ b/tests/system_info_tests.c @@ -122,8 +122,6 @@ static int s_test_platform_build_os_fn(struct aws_allocator *allocator, void *ct ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_IOS); #elif defined(AWS_OS_TVOS) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_TVOS); -#elif defined(AWS_OS_WATCHOS) - ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_WATCHOS); #elif defined(AWS_OS_ANDROID) ASSERT_INT_EQUALS(build_os, AWS_PLATFORM_OS_ANDROID); #elif defined(_WIN32)