| Server IP : 82.208.35.60 / Your IP : 216.73.216.168 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/lang/spidermonkey91/files/ |
Upload File : |
--- modules/fdlibm/src/math_private.h.orig 2022-04-16 03:20:29 UTC
+++ modules/fdlibm/src/math_private.h
@@ -30,7 +30,9 @@
* Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
*/
+#ifndef __FreeBSD__
typedef double __double_t;
+#endif
typedef __double_t double_t;
/*
@@ -636,6 +638,33 @@ rnint(__double_t x)
* sometimes be more efficient because no rounding is required.
*/
#if (defined(amd64) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
+
+#if defined(__i386__)
+static __inline int
+irintf(float x)
+{
+ int n;
+ __asm("fistl %0" : "=m" (n) : "t" (x));
+ return (n);
+}
+
+static __inline int
+irintd(double x)
+{
+ int n;
+ __asm("fistl %0" : "=m" (n) : "t" (x));
+ return (n);
+}
+
+static __inline int
+irintl(long x)
+{
+ int n;
+ __asm("fistl %0" : "=m" (n) : "t" (x));
+ return (n);
+}
+#endif
+
#define irint(x) \
(sizeof(x) == sizeof(float) && \
sizeof(__float_t) == sizeof(long double) ? irintf(x) : \