From: Alex Henrie alexhenrie24@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56078 --- dlls/msvcp140_2/Makefile.in | 3 +++ dlls/msvcp140_2/math.c | 26 ++++++++++++++++++++++++++ dlls/msvcp140_2/msvcp140_2.spec | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 dlls/msvcp140_2/math.c
diff --git a/dlls/msvcp140_2/Makefile.in b/dlls/msvcp140_2/Makefile.in index 5b4865db844..0f75819198f 100644 --- a/dlls/msvcp140_2/Makefile.in +++ b/dlls/msvcp140_2/Makefile.in @@ -1 +1,4 @@ MODULE = msvcp140_2.dll + +SOURCES = \ + math.c diff --git a/dlls/msvcp140_2/math.c b/dlls/msvcp140_2/math.c new file mode 100644 index 00000000000..e9ed96a1479 --- /dev/null +++ b/dlls/msvcp140_2/math.c @@ -0,0 +1,26 @@ +/* + * Special math functions + * + * Copyright 2024 Alex Henrie + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <math.h> + +double __std_smf_hypot3(double x, double y, double z) +{ + return sqrt(x * x + y * y + z * z); +} diff --git a/dlls/msvcp140_2/msvcp140_2.spec b/dlls/msvcp140_2/msvcp140_2.spec index c59da9aba9c..06984ebb784 100644 --- a/dlls/msvcp140_2/msvcp140_2.spec +++ b/dlls/msvcp140_2/msvcp140_2.spec @@ -28,7 +28,7 @@ @ stub __std_smf_expintf @ stub __std_smf_hermite @ stub __std_smf_hermitef -@ stub __std_smf_hypot3 +@ cdecl __std_smf_hypot3(double double double) @ stub __std_smf_hypot3f @ stub __std_smf_laguerre @ stub __std_smf_laguerref
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=141625
Your paranoid android.
=== debian11b (64 bit WoW report) ===
dinput: device8.c:2237: Test failed: 0x700: got key_state[0] 0
Piotr Caban (@piotr) commented about dlls/msvcp140_2/math.c:
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+#include <math.h>
+double __std_smf_hypot3(double x, double y, double z) +{
- return sqrt(x * x + y * y + z * z);
This should handle overflow during computations correctly: ```suggestion:-0+0 return hypot(hypot(x, y), z); ```
Piotr Caban (@piotr) commented about dlls/msvcp140_2/math.c:
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+#include <math.h>
+double __std_smf_hypot3(double x, double y, double z)
```suggestion:-0+0 double __cdecl __std_smf_hypot3(double x, double y, double z) ```