pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ocaml: Add workaround for NetBSD 9 math.h/copysign bug



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Thu Feb 24 08:03:30 2022 -0500
Changeset:	3b8c5f7573915a29d9821d41764e8c2c5c6877e5

Modified Files:
	ocaml/distinfo
Added Files:
	ocaml/patches/patch-runtime_floats.c

Log Message:
ocaml: Add workaround for NetBSD 9 math.h/copysign bug

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3b8c5f7573915a29d9821d41764e8c2c5c6877e5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ocaml/distinfo                       |  1 +
 ocaml/patches/patch-runtime_floats.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diffs:
diff --git a/ocaml/distinfo b/ocaml/distinfo
index ddfe36c8f8..8e50e61324 100644
--- a/ocaml/distinfo
+++ b/ocaml/distinfo
@@ -17,6 +17,7 @@ SHA1 (patch-otherlibs_systhreads_Makefile) = 17e4ff8b8eb7b4fff4570e0c0ded5986c9b
 SHA1 (patch-otherlibs_systhreads_st__stubs.c) = 3c0aa73f0e128646c01ed3855ee9c5645d5fa3f1
 SHA1 (patch-otherlibs_unix_Makefile) = 15425e037b287706b35e3beda72ddea0e2a5886c
 SHA1 (patch-runtime_Makefile) = e97f198f7eefbeeabc481104f71edad68167c956
+SHA1 (patch-runtime_floats.c) = 584a30d31c7b7da4f8387dc58b90fa1a8078f723
 SHA1 (patch-runtime_sak.c) = a2c2104c733a107e9129405aa146e1aaef52353f
 SHA1 (patch-testsuite_tests_lib-systhreads_testyield.ml) = 0f6d35e030de168c6f4aeb126055065ed47878aa
 SHA1 (patch-tools_Makefile) = 95db9b6151f89ea900ae7805f3456a19a02f70c0
diff --git a/ocaml/patches/patch-runtime_floats.c b/ocaml/patches/patch-runtime_floats.c
new file mode 100644
index 0000000000..10b9c04c01
--- /dev/null
+++ b/ocaml/patches/patch-runtime_floats.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+math.h on NetBSD 9 only declares copysign if _NETBSD_SOURCE is defined
+(implicitly or explicitly).  However copysign is specified by POSIX
+since Issue 6, and derived form C99:
+  https://pubs.opengroup.org/onlinepubs/9699919799/
+
+Not filed upstream pending discussion within NetBSD.
+
+--- runtime/floats.c.orig	2022-02-21 15:57:25.000000000 +0000
++++ runtime/floats.c
+@@ -23,6 +23,9 @@
+ /* Needed for strtod_l */
+ #define _GNU_SOURCE
+ 
++/* Work around NetBSD 9 math.h bug of guarding copysign decl */
++#define _NETBSD_SOURCE
++
+ #include <math.h>
+ #include <stdio.h>
+ #include <stdlib.h>


Home | Main Index | Thread Index | Old Index