{"thread":{"id":"59836","subject":"[PATCH] Use lowercase includes for some Windows headers","startedAt":"2023-06-04T21:22:49Z","lastAt":"2023-07-14T17:07:30Z","messageCount":3,"participants":["Mike Hommey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"478036","messageId":"20230604211934.1365289-1-mh@glandium.org","threadId":"59836","inReplyTo":null,"subject":"[PATCH] Use lowercase includes for some Windows headers","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2023-06-04T21:19:34Z","receivedAt":"2023-06-04T21:22:49Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"When cross-compiling with the mingw toolchain on a system with a case\nsensitive filesystem, the mixed case (which is technically correct as\nper the contents of MS Visual C++) doesn't work (the corresponding mingw\nheaders are all lowercase for some reason).\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\n---\n compat/win32/trace2_win32_process_info.c | 4 ++--\n wrapper.c                                | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c\nindex a4e33768f4..438af8f818 100644\n--- a/compat/win32/trace2_win32_process_info.c\n+++ b/compat/win32/trace2_win32_process_info.c\n@@ -3,8 +3,8 @@\n #include \"../../repository.h\"\n #include \"../../trace2.h\"\n #include \"lazyload.h\"\n-#include <Psapi.h>\n-#include <tlHelp32.h>\n+#include <psapi.h>\n+#include <tlhelp32.h>\n \n /*\n  * An arbitrarily chosen value to limit the size of the ancestor\ndiff --git a/wrapper.c b/wrapper.c\nindex 67f5f5dbe1..5dc48e815a 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -17,7 +17,7 @@ static intmax_t count_fsync_hardware_flush;\n #ifdef HAVE_RTLGENRANDOM\n /* This is required to get access to RtlGenRandom. */\n #define SystemFunction036 NTAPI SystemFunction036\n-#include <NTSecAPI.h>\n+#include <ntsecapi.h>\n #undef SystemFunction036\n #endif\n \n-- \n2.41.0.6.ge371d37104\n\n"},{"id":"478294","messageId":"xmqqmt14a36k.fsf@gitster.g","threadId":"59836","inReplyTo":"20230604211934.1365289-1-mh@glandium.org","subject":"Re: [PATCH] Use lowercase includes for some Windows headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-06-12T19:30:43Z","receivedAt":"2023-06-12T19:31:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> When cross-compiling with the mingw toolchain on a system with a case\n> sensitive filesystem, the mixed case (which is technically correct as\n> per the contents of MS Visual C++) doesn't work (the corresponding mingw\n> headers are all lowercase for some reason).\n>\n> Signed-off-by: Mike Hommey <mh@glandium.org>\n> ---\n>  compat/win32/trace2_win32_process_info.c | 4 ++--\n>  wrapper.c                                | 2 +-\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n\nI can guess that this will not break the primary target audience of\nthe source, who build from the source on case insensitive\nfilesystems.  The only possible breakage I can think of is if\ndifferent versions of mingw toolchain have these header files in\ndifferent cases---those who have been happily using header files\nlike <tlHelp32.h> on their case sensitive filesystem now will find\ntheir build to fail.  Theoretically, those who _corrected_ their\nheader files to mixed case themselves (as it is \"technically correct\nas per the contents of MS Visual C++\") will be broken the same way,\nbut they should be capable of diagnosing and recovering from such a\nbreakage, so I'm not worried about that.\n\nAppreciate input from those who builds with mingw toolchain, but in\nthe meantime let me queue it on 'seen' so that we won't forget.\n\nThanks.\n\n\n\n\n\n> diff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c\n> index a4e33768f4..438af8f818 100644\n> --- a/compat/win32/trace2_win32_process_info.c\n> +++ b/compat/win32/trace2_win32_process_info.c\n> @@ -3,8 +3,8 @@\n>  #include \"../../repository.h\"\n>  #include \"../../trace2.h\"\n>  #include \"lazyload.h\"\n> -#include <Psapi.h>\n> -#include <tlHelp32.h>\n> +#include <psapi.h>\n> +#include <tlhelp32.h>\n>  \n>  /*\n>   * An arbitrarily chosen value to limit the size of the ancestor\n> diff --git a/wrapper.c b/wrapper.c\n> index 67f5f5dbe1..5dc48e815a 100644\n> --- a/wrapper.c\n> +++ b/wrapper.c\n> @@ -17,7 +17,7 @@ static intmax_t count_fsync_hardware_flush;\n>  #ifdef HAVE_RTLGENRANDOM\n>  /* This is required to get access to RtlGenRandom. */\n>  #define SystemFunction036 NTAPI SystemFunction036\n> -#include <NTSecAPI.h>\n> +#include <ntsecapi.h>\n>  #undef SystemFunction036\n>  #endif\n"},{"id":"479525","messageId":"xmqqv8empgl4.fsf@gitster.g","threadId":"59836","inReplyTo":"xmqqmt14a36k.fsf@gitster.g","subject":"Re: [PATCH] Use lowercase includes for some Windows headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-14T17:07:19Z","receivedAt":"2023-07-14T17:07:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Mike Hommey <mh@glandium.org> writes:\n>\n>> When cross-compiling with the mingw toolchain on a system with a case\n>> sensitive filesystem, the mixed case (which is technically correct as\n>> per the contents of MS Visual C++) doesn't work (the corresponding mingw\n>> headers are all lowercase for some reason).\n>>\n>> Signed-off-by: Mike Hommey <mh@glandium.org>\n>> ---\n>>  compat/win32/trace2_win32_process_info.c | 4 ++--\n>>  wrapper.c                                | 2 +-\n>>  2 files changed, 3 insertions(+), 3 deletions(-)\n>\n> ...  The only possible breakage I can think of is if\n> different versions of mingw toolchain have these header files in\n> different cases---those who have been happily using header files\n> like <tlHelp32.h> on their case sensitive filesystem now will find\n> their build to fail.  Theoretically, those who _corrected_ their\n> header files to mixed case themselves (as it is \"technically correct\n> as per the contents of MS Visual C++\") will be broken the same way,\n> but they should be capable of diagnosing and recovering from such a\n> breakage, so I'm not worried about that.\n>\n> Appreciate input from those who builds with mingw toolchain, but in\n> the meantime let me queue it on 'seen' so that we won't forget.\n\nAnd a month has passed.  Unless I hear objections, I'll merge this\nchange to 'next' in a few days at most.\n\nThanks.\n\n>\n> Thanks.\n>\n>\n>\n>\n>\n>> diff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c\n>> index a4e33768f4..438af8f818 100644\n>> --- a/compat/win32/trace2_win32_process_info.c\n>> +++ b/compat/win32/trace2_win32_process_info.c\n>> @@ -3,8 +3,8 @@\n>>  #include \"../../repository.h\"\n>>  #include \"../../trace2.h\"\n>>  #include \"lazyload.h\"\n>> -#include <Psapi.h>\n>> -#include <tlHelp32.h>\n>> +#include <psapi.h>\n>> +#include <tlhelp32.h>\n>>  \n>>  /*\n>>   * An arbitrarily chosen value to limit the size of the ancestor\n>> diff --git a/wrapper.c b/wrapper.c\n>> index 67f5f5dbe1..5dc48e815a 100644\n>> --- a/wrapper.c\n>> +++ b/wrapper.c\n>> @@ -17,7 +17,7 @@ static intmax_t count_fsync_hardware_flush;\n>>  #ifdef HAVE_RTLGENRANDOM\n>>  /* This is required to get access to RtlGenRandom. */\n>>  #define SystemFunction036 NTAPI SystemFunction036\n>> -#include <NTSecAPI.h>\n>> +#include <ntsecapi.h>\n>>  #undef SystemFunction036\n>>  #endif\n"}]}