# error: typedef redefinition with different types ('__double_t' (aka 'double') vs 'long double')
# https://bugzilla.mozilla.org/show_bug.cgi?id=1729459

--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -30,9 +30,17 @@
  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
  */
 
+#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
+typedef long double      __double_t;
+typedef long double      __float_t;
+#elif defined __FLT_EVAL_METHOD__ && (__GLIBC_FLT_EVAL_METHOD == 0 || __GLIBC_FLT_EVAL_METHOD == 16)
+typedef double      __double_t;
+typedef float       __float_t;
+#else
 typedef double      __double_t;
+typedef double      __float_t;
+#endif
 typedef __double_t  double_t;
-typedef float       __float_t;
 
 /*
  * The original fdlibm code used statements like:
