Skip to content

Commit

Permalink
Consistently use lowercase for Windows libraries and header files
Browse files Browse the repository at this point in the history
Windows typically uses case-insensitive file systems, so the case of libraries
and header files is irrelevant, but MinGW consistently use lowercase names
everywhere, and when cross-compiling on Linux systems with case-sensitive file
systems the case of these names is very much relevant.
  • Loading branch information
giordano committed Sep 12, 2023
1 parent 2f8f082 commit 2a585e8
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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/*"
Expand All @@ -81,7 +81,7 @@ if (WIN32)
endif ()

list(APPEND PLATFORM_DEFINES WINDOWS_KERNEL_LIB=${WINDOWS_KERNEL_LIB})
list(APPEND PLATFORM_LIBS BCrypt ${WINDOWS_KERNEL_LIB} Ws2_32 Shlwapi)
list(APPEND PLATFORM_LIBS bcrypt ${WINDOWS_KERNEL_LIB} ws2_32 shlwapi)
else ()
file(GLOB AWS_COMMON_OS_HEADERS
"include/aws/common/posix/*"
Expand Down
2 changes: 1 addition & 1 deletion cmake/AwsFeatureTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if(NOT CMAKE_CROSSCOMPILING)
endif()

check_c_source_compiles("
#include <Windows.h>
#include <windows.h>
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
int main() {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/condition_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <aws/common/common.h>
#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 <pthread.h>
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/rw_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <aws/common/common.h>
#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 <pthread.h>
Expand Down
2 changes: 1 addition & 1 deletion include/aws/testing/aws_test_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,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 <Windows.h>
# include <windows.h>

# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
Expand Down
2 changes: 1 addition & 1 deletion source/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <stdlib.h>

#ifdef _WIN32
# include <Windows.h>
# include <windows.h>
#endif

#ifdef __MACH__
Expand Down
2 changes: 1 addition & 1 deletion source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <stdlib.h>

#ifdef _WIN32
# include <Windows.h>
# include <windows.h>
#else
# include <dlfcn.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/windows/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0.
*/

#include <Windows.h>
#include <windows.h>
#include <aws/common/clock.h>

static const uint64_t FILE_TIME_TO_NS = 100;
Expand Down
2 changes: 1 addition & 1 deletion source/windows/condition_variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <aws/common/clock.h>
#include <aws/common/mutex.h>

#include <Windows.h>
#include <windows.h>

#define AWSCV_TO_WINDOWS(pCV) (PCONDITION_VARIABLE) & (pCV)->condition_handle

Expand Down
2 changes: 1 addition & 1 deletion source/windows/device_random.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <aws/common/byte_buf.h>
#include <aws/common/thread.h>

#include <Windows.h>
#include <windows.h>
#include <bcrypt.h>

static BCRYPT_ALG_HANDLE s_alg_handle = NULL;
Expand Down
2 changes: 1 addition & 1 deletion source/windows/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <aws/common/logging.h>
#include <aws/common/string.h>

#include <Shlwapi.h>
#include <shlwapi.h>
#include <errno.h>
#include <io.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion source/windows/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <aws/common/mutex.h>
#include <aws/common/thread.h>

#include <Windows.h>
#include <windows.h>

/* Convert a string from a macro to a wide string */
#define WIDEN2(s) L## #s
Expand Down
2 changes: 1 addition & 1 deletion source/windows/rw_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <aws/common/rw_lock.h>
#include <aws/common/thread.h>

#include <Windows.h>
#include <windows.h>
#include <synchapi.h>

/* Convert a string from a macro to a wide string */
Expand Down
3 changes: 2 additions & 1 deletion source/windows/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include <aws/common/private/thread_shared.h>
#include <aws/common/string.h>

#include <Windows.h>
#include <windows.h>
#include <winnt.h>

#include <inttypes.h>

Expand Down

0 comments on commit 2a585e8

Please sign in to comment.