Skip to content

Commit

Permalink
POSIX: mingw64 doesn't make the bessel functions visible with -std=c99
Browse files Browse the repository at this point in the history
And doesn't provide a way to make them visible, even though they
are visible by default for MSVC UCRT builds.

The __MINGW32__ macro is set for both 32-bit and 64-bit MINGW builds.
  • Loading branch information
tonycoz committed Jun 3, 2024
1 parent 4ce0fbf commit 9c7bd8a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ext/POSIX/POSIX.xs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@

static int not_here(const char *s);

#if defined(__MINGW32__) && !defined(USE_QUADMATH)
/* If nvtype is long double, the bessel functions still *
* operate at "double precision" only - as in the past. *
* Mingw's math.h makes no provision for j0l, y0l, etc.
*
* Unfortunately the mingw64 supplied headers cannot be
* convinced to declare these functions with -std=c99.
*/
double __cdecl _hypot(double x, double y);
double __cdecl _j0(double d);
double __cdecl _j1(double d);
double __cdecl _jn(int n, double d);
double __cdecl _y0(double d);
double __cdecl _y1(double d);
double __cdecl _yn(int n, double d);
#endif

#if defined(PERL_IMPLICIT_SYS)
# undef signal
# undef open
Expand Down Expand Up @@ -572,7 +589,7 @@ static int not_here(const char *s);
# undef c99_trunc
#endif

#ifdef _MSC_VER
#if defined(_MSC_VER) || (defined(__MINGW32__) && !defined(USE_QUADMATH))

/* Some APIs exist under Win32 with "underbar" names. */
# undef c99_hypot
Expand Down

0 comments on commit 9c7bd8a

Please sign in to comment.