> I’m not sure what the fix should be, either. We could use fixinclude to make 
> the darwin headers happy, but we don’t really have a macro to provide the 
> right value. Like a __FLT_EVAL_METHOD_OLDSTYLE__ macro.
> 
> What should be the float_t and double_t types for FLT_EVAL_METHOD == 16? 
> float and double, if I understand right?

This is one possibility, assuming I am right about the types:

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 46e3b8c993a..bea85ef7367 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1767,6 +1767,18 @@ fix = {
     test_text = ""; /* Don't provide this for wrap fixes.  */
 };
 
+/*  The darwin headers don't accept __FLT_EVAL_METHOD__ == 16.
+*/
+fix = {
+    hackname  = darwin_flt_eval_method;
+    mach      = "*-*-darwin*";
+    files     = math.h;
+    select    = "^#if __FLT_EVAL_METHOD__ == 0$";
+    c_fix     = format;
+    c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16";
+    test_text = "#if __FLT_EVAL_METHOD__ == 0";
+};
+
 /*
  *  Fix <c_asm.h> on Digital UNIX V4.0:
  *  It contains a prototype for a DEC C internal asm() function,


Sucks to have to fix headers… and we certainly can’t fix people’s code that may 
depend on __FLT_EVAL_METHOD__ have well-defined values. So not convinced this 
is the right approach.

FX

Reply via email to