git/list[1] front-page[2] threads[3] people[4] search[5] about
 

js/win-lazyload-buildfix (was Re: What's cooking in git.git (Sep 2021, #07; Thu, 23))

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Sep 24, 2021, 09:14 UTC
Message-ID
<YU2W24RUaN4OHrcn@carlos-mbp.lan>
In-Reply-To
<xmqqa6k2yj1j.fsf@gitster.g>
On Thu, Sep 23, 2021 at 04:22:00PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> 
> * js/win-lazyload-buildfix (2021-09-23) 2 commits
>  - lazyload.h: use an even more generic function pointer than FARPROC
>  - lazyload.h: fix warnings about mismatching function pointer types
> 
>  Compilation fix.
> 
>  Will merge to 'next'.

Sorry to hijack this thread with this minor point, but I was hoping[1] from a reroll of this topic from Hannes.

Alternatively the patch below the scissors would be nice to squash or it will be harder to fix later.

Carlo
CC: +Hannes
[1] https://lore.kernel.org/git/CAPUEspivB=07OponiMrfXFBrC+L7qjSUuZEV9q-Ug5Z_ShnFNA@mail.gmail.com/
----- >8 -----
Subject: [PATCH] fixup! lazyload.h: fix warnings about mismatching function
 pointer types

The original patch will require the declaration this macro creates to be moved to the end of the local variables or will trigger -Wdeclaration-after-statement because it will likely end in ";;" if the macro call has one, as it is common.

Remove trailing ';' from macro definition, for easy of use.
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 compat/win32/lazyload.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/win32/lazyload.h b/compat/win32/lazyload.h
index c688e545ad..2b3637135f 100644
--- a/compat/win32/lazyload.h
+++ b/compat/win32/lazyload.h
@@ -29,7 +29,7 @@ struct proc_addr {
 	static struct proc_addr proc_addr_##function = \
 	{ #dll, #function, NULL, 0 }; \
 	typedef rettype (WINAPI *proc_type_##function)(__VA_ARGS__); \
-	static proc_type_##function function;
+	static proc_type_##function function
 
 /*
  * Loads a function from a DLL (once-only).
-- 
2.33.0.955.gee03ddbf0e
Previous: Elijah NewrenNext: Junio C Hamano
Message 4 of 8 in “What's cooking in git.git (Sep 2021, #07; Thu, 23)”
  1. Junio C HamanoSep 23, 2021
  2. Taylor BlauSep 23, 2021
  3. Elijah NewrenSep 24, 2021
  4. js/win-lazyload-buildfix (was Re: What's cooking in git.git (Sep 2021, #07; Thu, 23))Carlo Marcelo Arenas Belón, Sep 24, 2021
  5. Junio C HamanoSep 24, 2021
  6. Johannes SixtSep 24, 2021
  7. Andrzej HuntSep 26, 2021
  8. Junio C HamanoSep 27, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.