Thread (22 messages) 22 messages, 4 authors, 2021-09-29

Re: [PATCH cb/pedantic-build-for-developers] lazyload.h: fix warnings about mismatching function pointer types

flat view

From: Carlo Arenas <hidden>
Date: 2021-09-23 21:00:55

On Wed, Sep 22, 2021 at 12:56 PM Johannes Sixt [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/compat/win32/lazyload.h b/compat/win32/lazyload.h
index d2056cdadf..dc35cf080b 100644
--- a/compat/win32/lazyload.h
+++ b/compat/win32/lazyload.h
@@ -26,7 +26,8 @@ struct proc_addr {
 #define DECLARE_PROC_ADDR(dll, rettype, function, ...) \
        static struct proc_addr proc_addr_##function = \
        { #dll, #function, NULL, 0 }; \
-       static rettype (WINAPI *function)(__VA_ARGS__)
+       typedef rettype (WINAPI *proc_type_##function)(__VA_ARGS__); \
+       static proc_type_##function function;
dropping the trailing ";" here will also make this macro easier to use IMHO;
feel free to drop all the hunks moving declarations around from my
patch when you do if included in a reroll or let me know if I can help
otherwise.

Carlo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help