[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libdfp-patches] Correct placement of __STDC_WANT_DEC_FP__ guard in dfp/math.h
- To: libdfp-patches <libdfp-patches@xxxxxxxxxx>
- Subject: [libdfp-patches] Correct placement of __STDC_WANT_DEC_FP__ guard in dfp/math.h
- From: Ryan Arnold <rsa@xxxxxxxxxx>
- Date: Mon, 29 Nov 2010 10:48:35 -0600
I've added the following patches to libdfp upstream:
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
* README.user: Added clarification of how to include dfp/stdlib.h,
dfp/fenv.h and dfp/wchar.h.
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
* README.user: Added clarification of how to include dfp/math.h.
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
* dfp/math.h: Move #include_next <math.h> so that if the compiler
invocation has -I/<path>/include/dfp/ but doesn't define
__STDC_WANT_DEC_FP__ that they still get the system math.h.
There was a problem such that if -I/usr/include/dfp/ was prepended to
the search order but __STDC_WANT_DEC_FP was not defined then #include
<math.h> would pick up /usr/include/dfp/math.h but fail to
include /usr/include/math.h because of a misplaced #ifdef
__STDC_WANT_DEC_FP__ guard.
I've also updated the documentation on how to properly include the
Libdfp header files which override the system headers files, e.g.
stdlib.h, math.h, fenv.h, and wchar.h.
Signed-off-by: Ryan S. Arnold <rsa@xxxxxxxxxx>
Index: ChangeLog
===================================================================
--- ChangeLog (revision 12162)
+++ ChangeLog (revision 12163)
@@ -1,3 +1,9 @@
+2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
+
+ * dfp/math.h: Move #include_next <math.h> so that if the compiler
+ invocation has -I/<path>/include/dfp/ but doesn't define
+ __STDC_WANT_DEC_FP__ that they still get the system math.h.
+
2010-11-19 Ryan S. Arnold <rsa@xxxxxxxxxx>
* CONTRIBUTORS: Added Luis Machado. Added DCO requirements.
Index: dfp/math.h
===================================================================
--- dfp/math.h (revision 12162)
+++ dfp/math.h (revision 12163)
@@ -2,7 +2,7 @@
system math.h classification macros.
Copyright (C) 2006 IBM Corporation.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This file is part of the Decimal Floating Point C Library.
@@ -31,12 +31,15 @@
# error "dfp/<math.h> should be included before the system math.h."
#endif
-#ifdef __STDC_WANT_DEC_FP__
-
/* Include the system math.h first so that we can undef and redefine the
* classification functions to select for _Decimal[32|64|128] types. */
#include_next <math.h>
+/* Include this after the #include_next <math.h> so that if the user has
+ * -I/<path>/include/dfp/ on their compilation line but doesn't define
+ * __STDC_WANT_DEC_FPP that they still get the system math.h. */
+#ifdef __STDC_WANT_DEC_FP__
+
#include <features.h>
__BEGIN_DECLS
Index: README.user
===================================================================
--- README.user (revision 12163)
+++ README.user (revision 12164)
@@ -247,6 +247,16 @@
This mechanism allows Libdfp to add the Decimal interfaces required by the
specification to the aforementioned headers.
+In order to pick up the Libdfp math.h prototypes and classification macro
+overrides compile with the following:
+
+-I/pathto/include/dfp/ -D__STDC_WANT_DEC_FP__
+
+And then in the application source simply using the following include will
+pick up both /pathto/include/dfp/math.h and /usr/include/math.h:
+
+#include <math.h>
+
---------------------------------------------------------------------------
7. Compile and Link
Index: ChangeLog
===================================================================
--- ChangeLog (revision 12163)
+++ ChangeLog (revision 12164)
@@ -1,5 +1,9 @@
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
+ * README.user: Added clarification of how to include dfp/math.h.
+
+2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
+
* dfp/math.h: Move #include_next <math.h> so that if the compiler
invocation has -I/<path>/include/dfp/ but doesn't define
__STDC_WANT_DEC_FP__ that they still get the system math.h.
Index: README.user
===================================================================
--- README.user (revision 12164)
+++ README.user (working copy)
@@ -247,15 +247,18 @@
This mechanism allows Libdfp to add the Decimal interfaces required by the
specification to the aforementioned headers.
-In order to pick up the Libdfp math.h prototypes and classification macro
+In order to pick up the Libdfp prototypes and classification macro
overrides compile with the following:
-I/pathto/include/dfp/ -D__STDC_WANT_DEC_FP__
And then in the application source simply using the following include will
-pick up both /pathto/include/dfp/math.h and /usr/include/math.h:
+pick up both /pathto/include/dfp/<foo>.h and /usr/include/<foo>.h:
#include <math.h>
+#include <fenv.h>
+#include <stdlib.h>
+#include <wchar.h>
---------------------------------------------------------------------------
7. Compile and Link
Index: ChangeLog
===================================================================
--- ChangeLog (revision 12164)
+++ ChangeLog (working copy)
@@ -1,5 +1,10 @@
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
+ * README.user: Added clarification of how to include dfp/stdlib.h,
+ dfp/fenv.h and dfp/wchar.h.
+
+2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>
+
* README.user: Added clarification of how to include dfp/math.h.
2010-11-29 Ryan S. Arnold <rsa@xxxxxxxxxx>