]> git.ipfire.org Git - thirdparty/gcc.git/commit
fixincludes: Update darwin_flt_eval_method for macOS 14
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Mon, 11 Dec 2023 14:56:04 +0000 (15:56 +0100)
committerFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Mon, 11 Dec 2023 14:57:34 +0000 (15:57 +0100)
commit87e6cc0103369f8891c3c3a516f4d93187c2c12b
tree801ae429a16ff5b06925419d8ec8afe3814a9832
parentca66fffad38aff5e39a2eb6c580971a20accb383
fixincludes: Update darwin_flt_eval_method for macOS 14

On macOS 14, a guard in <math.h> changed:

-- MacOSX13.3.sdk/usr/include/math.h 2023-04-19 01:54:44
+++ MacOSX14.0.sdk/usr/include/math.h 2023-08-01 08:42:43
@@ -22,0 +23 @@
+
@@ -43 +44 @@
-#if __FLT_EVAL_METHOD__ == 0
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
@@ -49 +50 @@
-#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
+#elif __FLT_EVAL_METHOD__ == 2

Therefore the darwin_flt_eval_method fixincludes fix doesn't match any
longer, leading to a large number of testsuite failures like

/private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5:
error: #error "Unsupported value of __FLT_EVAL_METHOD__."

where __FLT_EVAL_METHOD__ = 16.

This patch adjusts the fix to allow for both forms.

Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and
verifying that <math.h> has indeed been fixed as expected.

(backport of 93f803d53b5ccaabded9d7b4512b54da81c1c616)

2023-12-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

fixincludes:
* inclhack.def (darwin_flt_eval_method): Handle macOS 14 guard
variant.
* fixincl.x: Regenerate.
* tests/base/math.h [DARWIN_FLT_EVAL_METHOD_CHECK]: Update test.
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/math.h