|Re: [hatari-devel] Removing SDL use for byte order checks / conversions|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
Defines should be upper case, and more than 2 letters I think.
IMHO better solution is just moving
the "ifndef M_PI, define M_PI" to a common header, after "include <math.h>".
On 5.10.2022 0.55, David Savinkoff wrote:
An unused M_PI define in src/falcon/dsp_core.c is the only M_PI in
Hatari that is not my fault.
I have come to the conclusion that the entirety of computer science
has had decades to find a way of representing pi and has failed.
Thus, the correct way of defining pi on a computer in C is as follows:
#define pi 3.14159265358979323846264338327950 /* use more digits if needed
Note that pi is lower case because pi is fundamentally more important than
Here are three patches to purge M_PI
On Mon, Oct 3, 2022 at 9:25 AM Christian Zietz <czietz@xxxxxxx> wrote:
David Savinkoff schrieb:
I think MSFT is trying to be a trouble maker here, so use the force.
It's always easy and convenient to blame Microsoft, I know. But -- as
Thomas already wrote -- M_PI is *not* part of math.h in ANSI C. You will
find that glibc's math.h does not define it unconditionally either:
... it's just that __USE_MISC or __USE_XOPEN is set somewhere else.
I would conditionally define M_PI most accurately in a future-proof way.
... and, therefore, this suggestion might be good solution.
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
New GnuPG-Key-ID: 0x8708B34C827B159E