[PATCH 0/7] MR6745: include: More fixes to build libc++.
I wasn't sure where to put `max_align_t` declarations, I think it's supposed to be directly in `cstddef` but we don't have it, `stddef.h` should be good enough? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/msvcrt/corecrt_wstring.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/msvcrt/corecrt_wstring.h b/include/msvcrt/corecrt_wstring.h index 02332787dc9..c72d88d2f43 100644 --- a/include/msvcrt/corecrt_wstring.h +++ b/include/msvcrt/corecrt_wstring.h @@ -90,4 +90,10 @@ _ACRTIMP wchar_t* __cdecl wcstok(wchar_t*,const wchar_t*); } #endif +#ifdef __cplusplus +extern "C++" { +template <size_t S> inline errno_t wcscat_s(wchar_t (&dst)[S], const wchar_t *arg) throw() { return wcscat_s(dst, S, arg); } +} /* extern "C++" */ +#endif /* __cplusplus */ + #endif /* _WSTRING_DEFINED */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/msvcrt/stdlib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index a4c27e9ab5e..9cb8ccb110a 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -273,6 +273,9 @@ inline errno_t getenv_s(size_t *ret, char (&buf)[size], const char *var) return getenv_s(ret, buf, size, var); } +inline long abs(long const x) throw() { return labs(x); } +inline long long abs(long long const x) throw() { return llabs(x); } + } /* extern "C++" */ } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/msvcrt/math.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index 5a41b061907..4f9840b3a02 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -426,5 +426,6 @@ static inline double y1( double x ) { return _y1( x ); } static inline double yn( int n, double x ) { return _yn( n, x ); } static inline float hypotf( float x, float y ) { return _hypotf( x, y ); } +static inline long double atan2l( long double x, long double y ) { return atan2( (double)y, (double)x ); } #endif /* __WINE_MATH_H */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/msvcrt/stddef.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/msvcrt/stddef.h b/include/msvcrt/stddef.h index b3fdaf0c052..e1ce7b0c3db 100644 --- a/include/msvcrt/stddef.h +++ b/include/msvcrt/stddef.h @@ -28,6 +28,7 @@ #define offsetof(s,m) (size_t)&(((s*)NULL)->m) #endif +typedef double max_align_t; #ifdef __cplusplus extern "C" { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/winbase.h | 1 + include/winnt.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/winbase.h b/include/winbase.h index fe143cc7a61..b81203226ae 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2978,6 +2978,7 @@ WINBASEAPI UINT WINAPI _lwrite(HFILE,LPCSTR,UINT); #define ZeroMemory RtlZeroMemory #define CopyMemory RtlCopyMemory #define SecureZeroMemory RtlSecureZeroMemory +#define CaptureStackBackTrace RtlCaptureStackBackTrace /* Wine internal functions */ diff --git a/include/winnt.h b/include/winnt.h index 46131a40817..4b333f4ef33 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6217,6 +6217,7 @@ NTSYSAPI VOID WINAPI RtlRunOnceInitialize(PRTL_RUN_ONCE); NTSYSAPI DWORD WINAPI RtlRunOnceExecuteOnce(PRTL_RUN_ONCE,PRTL_RUN_ONCE_INIT_FN,PVOID,PVOID*); NTSYSAPI DWORD WINAPI RtlRunOnceBeginInitialize(PRTL_RUN_ONCE, DWORD, PVOID*); NTSYSAPI DWORD WINAPI RtlRunOnceComplete(PRTL_RUN_ONCE, DWORD, PVOID); +NTSYSAPI WORD WINAPI RtlCaptureStackBackTrace(DWORD,DWORD,void**,DWORD*); #include <pshpack8.h> typedef struct _IO_COUNTERS { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/winbase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/winbase.h b/include/winbase.h index b81203226ae..c775ab71694 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1723,6 +1723,7 @@ typedef enum _PROC_THREAD_ATTRIBUTE_NUM #define PROC_THREAD_ATTRIBUTE_ENABLE_OPTIONAL_XSTATE_FEATURES (ProcThreadAttributeEnableOptionalXStateFeatures | PROC_THREAD_ATTRIBUTE_THREAD | PROC_THREAD_ATTRIBUTE_INPUT) #define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1) +#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2) #define VALID_SYMBOLIC_LINK_FLAGS SYMBOLIC_LINK_FLAG_DIRECTORY typedef struct _STARTUPINFOEXA -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index 4b333f4ef33..c810830b2b3 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -3224,7 +3224,7 @@ typedef struct _IMAGE_EXPORT_DIRECTORY { /* Import name entry */ typedef struct _IMAGE_IMPORT_BY_NAME { WORD Hint; - BYTE Name[1]; + char Name[1]; } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME; #include <pshpack8.h> -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
Jacek Caban (@jacek) commented about include/winnt.h:
NTSYSAPI DWORD WINAPI RtlRunOnceExecuteOnce(PRTL_RUN_ONCE,PRTL_RUN_ONCE_INIT_FN,PVOID,PVOID*); NTSYSAPI DWORD WINAPI RtlRunOnceBeginInitialize(PRTL_RUN_ONCE, DWORD, PVOID*); NTSYSAPI DWORD WINAPI RtlRunOnceComplete(PRTL_RUN_ONCE, DWORD, PVOID); +NTSYSAPI WORD WINAPI RtlCaptureStackBackTrace(DWORD,DWORD,void**,DWORD*); This is defined in `rtlsupportapi.h` in winsdk.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745#note_86305
On Tue Oct 29 14:27:00 2024 +0000, Jacek Caban wrote:
This is defined in `rtlsupportapi.h` in winsdk. and while you're at it, the functions in rtlsupportapi.h should be enclosed in extern "C" as well...
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745#note_86316
On Tue Oct 29 15:47:16 2024 +0000, eric pouech wrote:
and while you're at it, the functions in rtlsupportapi.h should be enclosed in extern "C" as well... Fwiw it's also defined in winnt.h as far as I can see, with guards that we don't have, probably to make sure it's not defined multiple times.
Then I'm not sure it's actually needed by default, I probably encountered it with some flags I later dropped, probably when it was building the sanatizers, and the definitions we already have in rtlsupportapi.h were not enough. But I'll leave it aside for now. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745#note_86317
On Tue Oct 29 15:51:31 2024 +0000, Rémi Bernon wrote:
Fwiw it's also defined in winnt.h as far as I can see, with guards that we don't have, probably to make sure it's not defined multiple times. Then I'm not sure it's actually needed by default, I probably encountered it with some flags I later dropped, probably when it was building the sanatizers, and the definitions we already have in rtlsupportapi.h were not enough. But I'll leave it aside for now. Ah, I somehow missed it in `winnt.h`, looks good then. Thanks.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745#note_86323
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6745
participants (3)
-
eric pouech (@epo) -
Jacek Caban (@jacek) -
Rémi Bernon