From 15a25349d59852e2655c0920835644f2eb948d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 13 Feb 2024 18:09:29 +0000 Subject: [PATCH] Consistently use lowercase for Windows libraries and header files (#1058) Co-authored-by: Michael Graeb --- CMakeLists.txt | 4 ++-- cmake/AwsFeatureTests.cmake | 2 +- include/aws/common/condition_variable.h | 2 +- include/aws/common/mutex.h | 2 +- include/aws/common/rw_lock.h | 2 +- include/aws/testing/aws_test_harness.h | 2 +- source/allocator.c | 2 +- source/common.c | 2 +- source/windows/clock.c | 2 +- source/windows/condition_variable.c | 2 +- source/windows/device_random.c | 3 ++- source/windows/file.c | 2 +- source/windows/mutex.c | 2 +- source/windows/rw_lock.c | 3 ++- source/windows/thread.c | 2 +- 15 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47d8714f2..74f1ae059 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ file (GLOB AWS_COMMON_EXTERNAL_SRC option(AWS_NUM_CPU_CORES "Number of CPU cores of the target machine. Useful when cross-compiling." 0) if (WIN32) - set(WINDOWS_KERNEL_LIB "Kernel32" CACHE STRING "The name of the kernel library to link against (default: Kernel32)") + set(WINDOWS_KERNEL_LIB "kernel32" CACHE STRING "The name of the kernel library to link against (default: kernel32)") file(GLOB AWS_COMMON_OS_HEADERS "include/aws/common/windows/*" @@ -84,7 +84,7 @@ if (WIN32) # PSAPI_VERSION=1 is needed to support GetProcessMemoryInfo on both pre and # post Win7 OS's. list(APPEND PLATFORM_DEFINES PSAPI_VERSION=1) - list(APPEND PLATFORM_LIBS BCrypt ${WINDOWS_KERNEL_LIB} Ws2_32 Shlwapi Psapi) + list(APPEND PLATFORM_LIBS bcrypt ${WINDOWS_KERNEL_LIB} ws2_32 shlwapi psapi) else () file(GLOB AWS_COMMON_OS_HEADERS "include/aws/common/posix/*" diff --git a/cmake/AwsFeatureTests.cmake b/cmake/AwsFeatureTests.cmake index da27994ec..60a548cfd 100644 --- a/cmake/AwsFeatureTests.cmake +++ b/cmake/AwsFeatureTests.cmake @@ -35,7 +35,7 @@ if(NOT CMAKE_CROSSCOMPILING) endif() check_c_source_compiles(" - #include + #include #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) int main() { return 0; diff --git a/include/aws/common/condition_variable.h b/include/aws/common/condition_variable.h index 317dedb9c..ba5984cb8 100644 --- a/include/aws/common/condition_variable.h +++ b/include/aws/common/condition_variable.h @@ -33,7 +33,7 @@ struct aws_condition_variable { * You can do something like struct aws_condition_variable var = * AWS_CONDITION_VARIABLE_INIT; * - * If on Windows and you get an error about AWS_CONDITION_VARIABLE_INIT being undefined, please include Windows.h to get + * If on Windows and you get an error about AWS_CONDITION_VARIABLE_INIT being undefined, please include windows.h to get * CONDITION_VARIABLE_INIT. */ #ifdef _WIN32 diff --git a/include/aws/common/mutex.h b/include/aws/common/mutex.h index b64e5e32f..3a491abc9 100644 --- a/include/aws/common/mutex.h +++ b/include/aws/common/mutex.h @@ -8,7 +8,7 @@ #include #ifdef _WIN32 -/* NOTE: Do not use this macro before including Windows.h */ +/* NOTE: Do not use this macro before including windows.h */ # define AWSMUTEX_TO_WINDOWS(pMutex) (PSRWLOCK) & (pMutex)->mutex_handle #else # include diff --git a/include/aws/common/rw_lock.h b/include/aws/common/rw_lock.h index f8d86ae2a..538841f63 100644 --- a/include/aws/common/rw_lock.h +++ b/include/aws/common/rw_lock.h @@ -8,7 +8,7 @@ #include #ifdef _WIN32 -/* NOTE: Do not use this macro before including Windows.h */ +/* NOTE: Do not use this macro before including windows.h */ # define AWSSRW_TO_WINDOWS(pCV) (PSRWLOCK) pCV #else # include diff --git a/include/aws/testing/aws_test_harness.h b/include/aws/testing/aws_test_harness.h index 88927c2b0..d4d258b2c 100644 --- a/include/aws/testing/aws_test_harness.h +++ b/include/aws/testing/aws_test_harness.h @@ -513,7 +513,7 @@ static inline int s_aws_run_test_case(struct aws_test_harness *harness) { /* https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences */ #ifdef _WIN32 -# include +# include # ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING # define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 diff --git a/source/allocator.c b/source/allocator.c index 02847b1ae..d3d1e98bd 100644 --- a/source/allocator.c +++ b/source/allocator.c @@ -12,7 +12,7 @@ #include #ifdef _WIN32 -# include +# include #endif #ifdef __MACH__ diff --git a/source/common.c b/source/common.c index f734c16e6..2c971b5b4 100644 --- a/source/common.c +++ b/source/common.c @@ -14,7 +14,7 @@ #include #ifdef _WIN32 -# include +# include #else # include #endif diff --git a/source/windows/clock.c b/source/windows/clock.c index b7b0b3820..11a5abb62 100644 --- a/source/windows/clock.c +++ b/source/windows/clock.c @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include #include +#include static const uint64_t FILE_TIME_TO_NS = 100; static const uint64_t EC_TO_UNIX_EPOCH = 11644473600LL; diff --git a/source/windows/condition_variable.c b/source/windows/condition_variable.c index 5a989ead0..07d6a0cdd 100644 --- a/source/windows/condition_variable.c +++ b/source/windows/condition_variable.c @@ -8,7 +8,7 @@ #include #include -#include +#include #define AWSCV_TO_WINDOWS(pCV) (PCONDITION_VARIABLE) & (pCV)->condition_handle diff --git a/source/windows/device_random.c b/source/windows/device_random.c index 0233d6890..6cb92d43e 100644 --- a/source/windows/device_random.c +++ b/source/windows/device_random.c @@ -7,7 +7,8 @@ #include #include -#include +#include + #include static BCRYPT_ALG_HANDLE s_alg_handle = NULL; diff --git a/source/windows/file.c b/source/windows/file.c index 7d4bb96d6..b3dfdf92c 100644 --- a/source/windows/file.c +++ b/source/windows/file.c @@ -8,9 +8,9 @@ #include #include -#include #include #include +#include #include #include diff --git a/source/windows/mutex.c b/source/windows/mutex.c index aedefd2af..75e7a23d1 100644 --- a/source/windows/mutex.c +++ b/source/windows/mutex.c @@ -6,7 +6,7 @@ #include #include -#include +#include /* Convert a string from a macro to a wide string */ #define WIDEN2(s) L## #s diff --git a/source/windows/rw_lock.c b/source/windows/rw_lock.c index 36cc81aa9..72a6e4378 100644 --- a/source/windows/rw_lock.c +++ b/source/windows/rw_lock.c @@ -6,7 +6,8 @@ #include #include -#include +#include + #include /* Convert a string from a macro to a wide string */ diff --git a/source/windows/thread.c b/source/windows/thread.c index 9124afefb..b172178ce 100644 --- a/source/windows/thread.c +++ b/source/windows/thread.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include