[PATCH v2 0/1] MR9103: ntdll/unix: Explicitly cast to XSAVE_FORMAT* before dereferencing FPUX_sig
This will fixes build on FreeBSD targeting i386. -- v2: ntdll/unix: Explicitly cast the NULL value for FPU_sig, FPUX_sig and XState_sig to the correct one https://gitlab.winehq.org/wine/wine/-/merge_requests/9103
From: Thibault Payet <contact(a)thibaultpayet.fr> This would allow building on all the supported platform despite some function not supported yet. Co-authored-by: Jinoh Kang --- dlls/ntdll/unix/signal_i386.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index d4fac225430..dfa18b3570b 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -213,9 +213,9 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define EIP_sig(context) ((context)->uc_mcontext.mc_eip) #define ESP_sig(context) ((context)->uc_mcontext.mc_esp) -#define FPU_sig(context) NULL /* FIXME */ -#define FPUX_sig(context) NULL /* FIXME */ -#define XState_sig(context) NULL /* FIXME */ +#define FPU_sig(context) ((FLOATING_SAVE_AREA *) NULL) /* FIXME */ +#define FPUX_sig(context) ((XSAVE_FORMAT *) NULL) /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #elif defined (__OpenBSD__) @@ -244,9 +244,9 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define EIP_sig(context) ((context)->sc_eip) #define ESP_sig(context) ((context)->sc_esp) -#define FPU_sig(context) NULL /* FIXME */ -#define FPUX_sig(context) NULL /* FIXME */ -#define XState_sig(context) NULL /* FIXME */ +#define FPU_sig(context) ((FLOATING_SAVE_AREA *) NULL) /* FIXME */ +#define FPUX_sig(context) ((XSAVE_FORMAT *) NULL) /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #define T_MCHK T_MACHK #define T_XMMFLT T_XFTRAP @@ -290,9 +290,9 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define ERROR_sig(context) ((context)->uc_mcontext.gregs[ERR]) #define TRAP_sig(context) ((context)->uc_mcontext.gregs[TRAPNO]) -#define FPU_sig(context) NULL /* FIXME */ -#define FPUX_sig(context) NULL /* FIXME */ -#define XState_sig(context) NULL /* FIXME */ +#define FPU_sig(context) ((FLOATING_SAVE_AREA *) NULL) /* FIXME */ +#define FPUX_sig(context) ((XSAVE_FORMAT *) NULL) /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #elif defined (__APPLE__) @@ -316,9 +316,10 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define ESP_sig(context) ((context)->uc_mcontext->__ss.__esp) #define TRAP_sig(context) ((context)->uc_mcontext->__es.__trapno) #define ERROR_sig(context) ((context)->uc_mcontext->__es.__err) -#define FPU_sig(context) NULL + +#define FPU_sig(context) ((FLOATING_SAVE_AREA *) NULL) /* FIXME */ #define FPUX_sig(context) ((XSAVE_FORMAT *)&(context)->uc_mcontext->__fs.__fpu_fcw) -#define XState_sig(context) NULL /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #elif defined(__NetBSD__) @@ -346,9 +347,9 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) #define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) -#define FPU_sig(context) NULL +#define FPU_sig(context) ((FLOATING_SAVE_AREA *) NULL) /* FIXME */ #define FPUX_sig(context) ((XSAVE_FORMAT *)&((context)->uc_mcontext.__fpregs)) -#define XState_sig(context) NULL /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #define T_MCHK T_MCA #define T_XMMFLT T_XMM @@ -380,8 +381,8 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) #define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) #define FPU_sig(context) ((FLOATING_SAVE_AREA *)&(context)->uc_mcontext.fpregs.fp_reg_set.fpchip_state) -#define FPUX_sig(context) NULL -#define XState_sig(context) NULL /* FIXME */ +#define FPUX_sig(context) ((XSAVE_FORMAT *) NULL) /* FIXME */ +#define XState_sig(context) ((XSAVE_AREA_HEADER *) NULL) /* FIXME */ #else #error You must define the signal context functions for your platform -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9103
On Sun Oct 5 18:31:58 2025 +0000, Thibault Payet wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/9103/diffs?diff_id=214503&start_sha=74b8a679915352efdadb0a9bb1ba8c1688f050e5#fdd8c54a2afb459527e98d3e3ccbbc6ca451c5b5_217_216) I have applied the cast on each FIXME part, so that it also applies to other OS
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9103#note_117629
This merge request was approved by Jinoh Kang. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9103
The first version was better IMO. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9103#note_117643
This merge request was closed by Alexandre Julliard. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9103
Superseded by 0d7b26b169761d63198c4700764d08224137d99c. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9103#note_121015
participants (4)
-
Alexandre Julliard (@julliard) -
Jinoh Kang (@iamahuman) -
Thibault Payet -
Thibault Payet (@thpayet)