Re: [hatari-devel] Removing SDL use for byte order checks / conversions

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 03/10/2022 à 14:18, Thomas Huth a écrit :
Am Mon, 3 Oct 2022 11:11:42 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

Hi,

On 2.10.2022 22.05, Christian Zietz wrote:
Thomas Huth schrieb:
Without that, compilation was broken with VisualStudio:

https://cirrus-ci.com/task/6045603464478720?logs=main#L752

See:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170

Ok, Thanks!

So better solution than the SDL include, would be adding this to
"main.h", before <math.h> include:
	#define _USE_MATH_DEFINES  // for MSVC

Thomas, could you try that in your CI?

Not sure if that's really better - if I've got that right, M_PI and the
other constants are not part of POSIX or the C standard, so there might be
other systems where M_PI is not defined. OTOH, SDL_stdinc.h always makes
sure that it is defined, so unless we really really need to make dmaSnd.c
independent from the SDL headers, using SDL_stdinc.h is maybe the easier
choice here.

Or if we really just need M_PI, maybe we can define it ourselves if it's not already there with our own prefix ?

#define HATARI_M_PI 3.14xxxxx

That's just in case we really want to get rid of as many SDL includes as possible ; if not, we can keep SDL_stdinc.h if it solves cases for all possible combination of architectures / compilers.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/