Removed SDL_stdinc.h dependency on HAVE_M_PI, added SDL_M_PIl (double) and SDL_M_PIf (float) instead

This commit is contained in:
Sam Lantinga 2022-11-25 10:33:37 -08:00
parent 8733927e35
commit 670f1df469
16 changed files with 38 additions and 44 deletions

View file

@ -80,13 +80,6 @@
# include <ctype.h>
#endif
#ifdef HAVE_MATH_H
# if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
for more information.
*/
# define _USE_MATH_DEFINES
# endif
# include <math.h>
#endif
#ifdef HAVE_FLOAT_H
@ -615,10 +608,11 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size
extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap);
#ifndef HAVE_M_PI
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288 /**< pi */
#ifndef SDL_M_PIl
#define SDL_M_PIl 3.141592653589793238462643383279502884L /**< pi (double) */
#endif
#ifndef SDL_M_PIf
#define SDL_M_PIf ((float)3.141592653589793238462643383279502884) /**< pi (float) */
#endif
/**