On 2024-10-10 15:45, Morten Brørup wrote:
From: Mattias Rönnblom [mailto:hof...@lysator.liu.se]
Sent: Thursday, 10 October 2024 15.40
On 2024-10-10 13:47, Morten Brørup wrote:
From: Mattias Rönnblom [mailto:hof...@lysator.liu.se]
Sent: Thursday, 10 October 2024 12.40
On 2024-10-10 00:15, Morten Brørup wrote:
From what I can read on the internet, max_align_t is missing in
stddef.h in MSVC [1], so try adding this to fix the Windows CI
compilation failure:
#ifdef RTE_TOOLCHAIN_MSVC
#include <cstddef>
#endif
Please excuse my MSVC ignorance, but will this work in C? Looks like
C++.
I have no clue. Just parroting what Microsoft says on the internet.
You can try it out and see if the CI accepts it.
It wouldn't make sense if that worked, so I'll go for this instead:
#ifdef RTE_TOOLCHAIN_MSVC
/* MSVC <stddef.h> is missing the max_align_t typedef */
Maybe also add some reference to why "double" is the max aligned type in MSVC.
align = alignof(double);
#else
align = alignof(max_align_t);
#endif
Even better!
It's a good workaround, and not an ugly hack like the ones suggested by me.
Still a hack, I would argue.
Maybe this is an issue meson could help solve? Detect the missing
max_align_t, and then do something appropriate about it. (Not sure
exactly what that would be.)
Thanks for pointing out this issue.
:-)