]> git.ipfire.org Git - thirdparty/git.git/commitdiff
clar: stop including `shellapi.h` unnecessarily
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 4 Sep 2024 14:16:59 +0000 (16:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2024 15:41:37 +0000 (08:41 -0700)
The `shellapi.h` header was included as of
https://github.com/clar-test/clar/commit/136e763211aa, to have
`SHFileOperation()` declared so that it could be called.

However, https://github.com/clar-test/clar/commit/5ce31b69b525 removed
that call, and therefore that `#include <shellapi.h>` is unnecessary.

It is also unwanted in Git because this project uses a subset of Git for
Windows' SDK in its CI builds that (for bandwidth reasons) excludes tons
of header files, including `shellapi.h`.

So let's remove it.

Note: Since the `windows.h` header would include `shellapi.h` anyway, we
also define `WIN32_LEAN_AND_MEAN` to avoid this and similar other
unnecessary includes before including `windows.h`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/clar/clar.c

index e2ebe551d3822f56e8ceb6fb9abdfaa98d4ef7e4..cef0f023c24bb3d8e9dc5ad3ffad524cfcbb606d 100644 (file)
@@ -19,9 +19,9 @@
 #include <sys/stat.h>
 
 #ifdef _WIN32
+#      define WIN32_LEAN_AND_MEAN
 #      include <windows.h>
 #      include <io.h>
-#      include <shellapi.h>
 #      include <direct.h>
 
 #      define _MAIN_CC __cdecl