On Mon, Jul 29, 2024 at 12:41 PM Björn Schäpers <g...@hazardy.de> wrote:
>
> > Instead of deleting those, move them inside the parentheses:
> >
> > typedef VOID (CALLBACK *LDR_DLL_NOTIFICATION)(ULONG,
> >                                             struct dll_notification_data*,
> >                                             PVOID);
> > typedef NTSTATUS (NTAPI *LDR_REGISTER_FUNCTION)(ULONG,
> >                                               LDR_DLL_NOTIFICATION, PVOID,
> >                                               PVOID*);
> >
> > and also I think you need to include <ntdef.h>, for the definition
> > of the NTSTATUS type.
> >
> > Caveat: I don't have MSVC, so I couldn't verify that these measures
> > fix the problem, sorry.
>
> Moving into the parentheses does fix the issue: 
> https://godbolt.org/z/Pe558ofYz
>
> NTSTATUS is typedefed directly before, so that no additional include is 
> needed.

Thanks.  I committed this patch.

Ian

            * pecoff.c (LDR_DLL_NOTIFICATION): Put function modifier
            inside parentheses.
            (LDR_REGISTER_FUNCTION): Likewise.
338a93ce71ccfd435c0f392af483cc946b2c26fc
diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c
index 636e1b11296..ccd5ccbce2c 100644
--- a/libbacktrace/pecoff.c
+++ b/libbacktrace/pecoff.c
@@ -83,10 +83,10 @@ struct dll_notification_data
 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
 
 typedef LONG NTSTATUS;
-typedef VOID CALLBACK (*LDR_DLL_NOTIFICATION)(ULONG,
+typedef VOID (CALLBACK *LDR_DLL_NOTIFICATION)(ULONG,
                                              struct dll_notification_data*,
                                              PVOID);
-typedef NTSTATUS NTAPI (*LDR_REGISTER_FUNCTION)(ULONG,
+typedef NTSTATUS (NTAPI *LDR_REGISTER_FUNCTION)(ULONG,
                                                LDR_DLL_NOTIFICATION, PVOID,
                                                PVOID*);
 #endif

Reply via email to