This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 495387197 build(c/driver_manager): use lowercase file names in
includes (#4608)
495387197 is described below
commit 4953871972cb422d3a00b1e8c204eaa8e21cc1a9
Author: eitsupi <[email protected]>
AuthorDate: Tue Jul 28 13:35:42 2026 +0900
build(c/driver_manager): use lowercase file names in includes (#4608)
`<KnownFolders.h>` and `<ShlObj.h>` are spelled the way the Windows SDK
ships them.
mingw-w64 ships these headers all-lowercase (`knownfolders.h`,
`shlobj.h`).
Windows filesystems are case-insensitive, so the lowercase spelling
resolves under both the SDK and mingw-w64, while the CamelCase spelling
only resolves when the lookup is case-insensitive.
The practical effect is that the driver manager currently cannot be
compiled from a case-sensitive filesystem, which rules out
cross-compiling for Windows from Linux.
Verified with https://github.com/mstorsjo/llvm-mingw 20260616 (clang
22.1.8, mingw-w64 15.0), compiling
`c/driver_manager/adbc_driver_manager.cc` with no include shims:
```
$ aarch64-w64-mingw32-clang++ -std=gnu++17 -O2 -Wall -DADBC_EXPORT= \
-Ic/include -Ic -Ic/vendor -c c/driver_manager/adbc_driver_manager.cc
# before
c/driver_manager/adbc_driver_manager.cc:33:10: fatal error:
'KnownFolders.h' file not found
# after
(ok)
```
---
c/driver_manager/adbc_driver_manager.cc | 8 ++++++--
go/adbc/drivermgr/adbc_driver_manager.cc | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/c/driver_manager/adbc_driver_manager.cc
b/c/driver_manager/adbc_driver_manager.cc
index 7013083cc..b3acca942 100644
--- a/c/driver_manager/adbc_driver_manager.cc
+++ b/c/driver_manager/adbc_driver_manager.cc
@@ -30,9 +30,13 @@
#endif
#include <windows.h> // Must come first
-#include <KnownFolders.h>
-#include <ShlObj.h>
+// Spell these lowercase: the Windows SDK ships them CamelCased, but mingw-w64
+// ships them all-lowercase. Windows filesystems are case-insensitive so the
+// lowercase spelling resolves for both, while the CamelCase spelling breaks
+// cross-compiling from a case-sensitive filesystem.
+#include <knownfolders.h>
#include <libloaderapi.h>
+#include <shlobj.h>
#include <string.h> // _wcsnicmp
// Without STRSAFE_NO_DEPRECATE, strsafe.h redefines strcpy/sprintf/etc. as
// poison macros, which breaks libc++'s <cstring>/<cstdio>/<cwchar> headers
diff --git a/go/adbc/drivermgr/adbc_driver_manager.cc
b/go/adbc/drivermgr/adbc_driver_manager.cc
index 7013083cc..b3acca942 100644
--- a/go/adbc/drivermgr/adbc_driver_manager.cc
+++ b/go/adbc/drivermgr/adbc_driver_manager.cc
@@ -30,9 +30,13 @@
#endif
#include <windows.h> // Must come first
-#include <KnownFolders.h>
-#include <ShlObj.h>
+// Spell these lowercase: the Windows SDK ships them CamelCased, but mingw-w64
+// ships them all-lowercase. Windows filesystems are case-insensitive so the
+// lowercase spelling resolves for both, while the CamelCase spelling breaks
+// cross-compiling from a case-sensitive filesystem.
+#include <knownfolders.h>
#include <libloaderapi.h>
+#include <shlobj.h>
#include <string.h> // _wcsnicmp
// Without STRSAFE_NO_DEPRECATE, strsafe.h redefines strcpy/sprintf/etc. as
// poison macros, which breaks libc++'s <cstring>/<cstdio>/<cwchar> headers