From 9fe4fc44558283faf938ab8e8847a00b574373c9 Mon Sep 17 00:00:00 2001
From: Ben Avison <bavison@gitlab.riscosopen.org>
Date: Fri, 12 Oct 2012 22:20:04 +0000
Subject: [PATCH] Merged in a fix to <math.h> from C compiler

Detail:
  This change was first applied to the inbuilt headers in the C compiler at
  version 5.59 (07 Apr 2005), but was accidentally not copied into the
  RISC_OSLib version of math.h. Fortunately, this would only have affected
  anyone compiling software with the -jC: switch.
Admin:
  Untested, but should be a safe change.

Version 5.74. Tagged as 'RISC_OSLib-5_74'
---
 VersionASM  | 12 ++++++------
 VersionNum  | 20 ++++++++++----------
 clib/h/math |  6 +++++-
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/VersionASM b/VersionASM
index fb6aa3a..3a997e7 100644
--- a/VersionASM
+++ b/VersionASM
@@ -11,13 +11,13 @@
                         GBLS    Module_HelpVersion
                         GBLS    Module_ComponentName
                         GBLS    Module_ComponentPath
-Module_MajorVersion     SETS    "5.73"
-Module_Version          SETA    573
+Module_MajorVersion     SETS    "5.74"
+Module_Version          SETA    574
 Module_MinorVersion     SETS    ""
-Module_Date             SETS    "25 Sep 2012"
-Module_ApplicationDate  SETS    "25-Sep-12"
+Module_Date             SETS    "12 Oct 2012"
+Module_ApplicationDate  SETS    "12-Oct-12"
 Module_ComponentName    SETS    "RISC_OSLib"
 Module_ComponentPath    SETS    "castle/RiscOS/Sources/Lib/RISC_OSLib"
-Module_FullVersion      SETS    "5.73"
-Module_HelpVersion      SETS    "5.73 (25 Sep 2012)"
+Module_FullVersion      SETS    "5.74"
+Module_HelpVersion      SETS    "5.74 (12 Oct 2012)"
                         END
diff --git a/VersionNum b/VersionNum
index 005f160..cc5cfc4 100644
--- a/VersionNum
+++ b/VersionNum
@@ -1,23 +1,23 @@
-/* (5.73)
+/* (5.74)
  *
  * This file is automatically maintained by srccommit, do not edit manually.
  * Last processed by srccommit version: 1.1.
  *
  */
-#define Module_MajorVersion_CMHG        5.73
+#define Module_MajorVersion_CMHG        5.74
 #define Module_MinorVersion_CMHG        
-#define Module_Date_CMHG                25 Sep 2012
+#define Module_Date_CMHG                12 Oct 2012
 
-#define Module_MajorVersion             "5.73"
-#define Module_Version                  573
+#define Module_MajorVersion             "5.74"
+#define Module_Version                  574
 #define Module_MinorVersion             ""
-#define Module_Date                     "25 Sep 2012"
+#define Module_Date                     "12 Oct 2012"
 
-#define Module_ApplicationDate          "25-Sep-12"
+#define Module_ApplicationDate          "12-Oct-12"
 
 #define Module_ComponentName            "RISC_OSLib"
 #define Module_ComponentPath            "castle/RiscOS/Sources/Lib/RISC_OSLib"
 
-#define Module_FullVersion              "5.73"
-#define Module_HelpVersion              "5.73 (25 Sep 2012)"
-#define Module_LibraryVersionInfo       "5:73"
+#define Module_FullVersion              "5.74"
+#define Module_HelpVersion              "5.74 (12 Oct 2012)"
+#define Module_LibraryVersionInfo       "5:74"
diff --git a/clib/h/math b/clib/h/math
index 1012d61..816992d 100644
--- a/clib/h/math
+++ b/clib/h/math
@@ -592,7 +592,11 @@ double __d_rem(double,double);
 #  endif
 #endif
 #define atan(x) __d_atan(x)
-#define fabs(x) ((void) sizeof (fabs)(x), __abs (double) (x))
+#ifdef __cplusplus
+#  define fabs(x) __d_abs(x)
+#else
+#  define fabs(x) ((void) sizeof (fabs)(x), __abs (double) (x))
+#endif
 #define floor(x) __d_floor(x)
 #define ceil(x) __d_ceil(x)
 #define trunc(x) __d_trunc(x)
-- 
GitLab