winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Huw Davies : localspl: Implement GetForm().
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 649821071caf13846cfd9283fe9ea18a183d2e4d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=649821071caf13846cfd9283…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed May 19 14:43:10 2021 +0100 localspl: Implement GetForm(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/localspl/provider.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index 69f70cdf541..c17983e3037 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -2714,8 +2714,44 @@ static BOOL WINAPI fpDeleteForm( HANDLE printer, WCHAR *name ) static BOOL WINAPI fpGetForm( HANDLE printer, WCHAR *name, DWORD level, BYTE *form, DWORD size, DWORD *needed ) { - FIXME( "(%p, %s, %d, %p, %d, %p): stub\n", printer, debugstr_w( name ), level, form, size, needed ); - return FALSE; + size_t struct_size = form_struct_size( level ); + const struct builtin_form *builtin = NULL; + WCHAR *strings = NULL; + BYTE *base = form; + DWORD i; + + TRACE( "(%p, %s, %d, %p, %d, %p)\n", printer, debugstr_w( name ), level, form, size, needed ); + + *needed = 0; + + if (!struct_size) return FALSE; + + for (i = 0; i < ARRAY_SIZE(builtin_forms); i++) + { + if (!wcscmp( name, builtin_forms[i].name )) + { + builtin = builtin_forms + i; + break; + } + } + + if (!builtin) + { + SetLastError( ERROR_INVALID_FORM_NAME ); + return FALSE; + } + + *needed = struct_size; + if (*needed < size) strings = (WCHAR *)(form + *needed); + + fill_builtin_form_info( &base, &strings, builtin, level, size, needed ); + + if (*needed > size) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + return TRUE; } static BOOL WINAPI fpSetForm( HANDLE printer, WCHAR *name, DWORD level, BYTE *form )
1
0
0
0
Huw Davies : localspl: Implement EnumForms().
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: bb51415904cb4cf4e45b3c7130b9ab9722b71ce9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bb51415904cb4cf4e45b3c71…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed May 19 14:43:09 2021 +0100 localspl: Implement EnumForms(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/localspl/localmon.c | 8 +- dlls/localspl/localspl.rc | 120 +++++++++ dlls/localspl/localspl_private.h | 119 +++++++++ dlls/localspl/provider.c | 222 ++++++++++++++- dlls/winspool.drv/info.c | 12 + po/ar.po | 553 ++++++++++++++++++++++++++++++++++++++ po/ast.po | 505 ++++++++++++++++++++++++++++++++++ po/bg.po | 485 +++++++++++++++++++++++++++++++++ po/ca.po | 565 +++++++++++++++++++++++++++++++++++++++ po/cs.po | 553 ++++++++++++++++++++++++++++++++++++++ po/da.po | 553 ++++++++++++++++++++++++++++++++++++++ po/de.po | 565 +++++++++++++++++++++++++++++++++++++++ po/el.po | 466 ++++++++++++++++++++++++++++++++ po/en.po | 464 ++++++++++++++++++++++++++++++++ po/en_US.po | 464 ++++++++++++++++++++++++++++++++ po/eo.po | 490 +++++++++++++++++++++++++++++++++ po/es.po | 565 +++++++++++++++++++++++++++++++++++++++ po/fa.po | 466 ++++++++++++++++++++++++++++++++ po/fi.po | 565 +++++++++++++++++++++++++++++++++++++++ po/fr.po | 553 ++++++++++++++++++++++++++++++++++++++ po/he.po | 499 ++++++++++++++++++++++++++++++++++ po/hi.po | 479 +++++++++++++++++++++++++++++++++ po/hr.po | 553 ++++++++++++++++++++++++++++++++++++++ po/hu.po | 553 ++++++++++++++++++++++++++++++++++++++ po/it.po | 553 ++++++++++++++++++++++++++++++++++++++ po/ja.po | 565 +++++++++++++++++++++++++++++++++++++++ po/ko.po | 565 +++++++++++++++++++++++++++++++++++++++ po/lt.po | 565 +++++++++++++++++++++++++++++++++++++++ po/ml.po | 464 ++++++++++++++++++++++++++++++++ po/nb_NO.po | 565 +++++++++++++++++++++++++++++++++++++++ po/nl.po | 565 +++++++++++++++++++++++++++++++++++++++ po/or.po | 464 ++++++++++++++++++++++++++++++++ po/pa.po | 464 ++++++++++++++++++++++++++++++++ po/pl.po | 565 +++++++++++++++++++++++++++++++++++++++ po/pt_BR.po | 565 +++++++++++++++++++++++++++++++++++++++ po/pt_PT.po | 563 ++++++++++++++++++++++++++++++++++++++ po/rm.po | 464 ++++++++++++++++++++++++++++++++ po/ro.po | 565 +++++++++++++++++++++++++++++++++++++++ po/ru.po | 565 +++++++++++++++++++++++++++++++++++++++ po/si.po | 553 ++++++++++++++++++++++++++++++++++++++ po/sk.po | 505 ++++++++++++++++++++++++++++++++++ po/sl.po | 553 ++++++++++++++++++++++++++++++++++++++ po/sr_RS(a)cyrillic.po | 471 ++++++++++++++++++++++++++++++++ po/sr_RS(a)latin.po | 477 +++++++++++++++++++++++++++++++++ po/sv.po | 521 ++++++++++++++++++++++++++++++++++++ po/ta.po | 464 ++++++++++++++++++++++++++++++++ po/te.po | 464 ++++++++++++++++++++++++++++++++ po/th.po | 468 ++++++++++++++++++++++++++++++++ po/tr.po | 565 +++++++++++++++++++++++++++++++++++++++ po/uk.po | 553 ++++++++++++++++++++++++++++++++++++++ po/wa.po | 466 ++++++++++++++++++++++++++++++++ po/wine.pot | 464 ++++++++++++++++++++++++++++++++ po/zh_CN.po | 565 +++++++++++++++++++++++++++++++++++++++ po/zh_TW.po | 553 ++++++++++++++++++++++++++++++++++++++ 54 files changed, 26069 insertions(+), 7 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=bb51415904cb4cf4e45b…
1
0
0
0
Huw Davies : winspool: Forward the unicode forms functions to localspl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 7d4a7f855760a1d6d27a80cfdb39ec14821e219b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d4a7f855760a1d6d27a80cf…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed May 19 14:43:08 2021 +0100 winspool: Forward the unicode forms functions to localspl. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/localspl/provider.c | 41 ++++++++++++++++++++--- dlls/winspool.drv/info.c | 87 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 103 insertions(+), 25 deletions(-) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index 7dde72d323d..51e0cedadb1 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -2506,6 +2506,37 @@ static BOOL WINAPI fpXcvData(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, return TRUE; } +static BOOL WINAPI fpAddForm( HANDLE printer, DWORD level, BYTE *form ) +{ + FIXME( "(%p, %d, %p): stub\n", printer, level, form ); + return TRUE; +} + +static BOOL WINAPI fpDeleteForm( HANDLE printer, WCHAR *name ) +{ + FIXME( "(%p, %s): stub\n", printer, debugstr_w( name ) ); + return TRUE; +} + +static BOOL WINAPI fpGetForm( HANDLE printer, WCHAR *name, DWORD level, BYTE *form, DWORD size, DWORD *needed ) +{ + FIXME( "(%p, %s, %d, %p, %d, %p): stub\n", printer, debugstr_w( name ), level, form, size, needed ); + return FALSE; +} + +static BOOL WINAPI fpSetForm( HANDLE printer, WCHAR *name, DWORD level, BYTE *form ) +{ + FIXME( "(%p, %s, %d, %p): stub\n", printer, debugstr_w( name ), level, form ); + return FALSE; +} + +static BOOL WINAPI fpEnumForms( HANDLE printer, DWORD level, BYTE *form, DWORD size, DWORD *needed, DWORD *count ) +{ + FIXME( "(%p, %d, %p, %d, %p, %p): stub\n", printer, level, form, size, needed, count ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + static const PRINTPROVIDOR backend = { fpOpenPrinter, NULL, /* fpSetJob */ @@ -2539,11 +2570,11 @@ static const PRINTPROVIDOR backend = { NULL, /* fpSetPrinterData */ NULL, /* fpWaitForPrinterChange */ fpClosePrinter, - NULL, /* fpAddForm */ - NULL, /* fpDeleteForm */ - NULL, /* fpGetForm */ - NULL, /* fpSetForm */ - NULL, /* fpEnumForms */ + fpAddForm, + fpDeleteForm, + fpGetForm, + fpSetForm, + fpEnumForms, fpEnumMonitors, fpEnumPorts, fpAddPort, diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 4d0542d20e3..368584c2382 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -526,6 +526,13 @@ static LPCWSTR get_opened_printer_name(HANDLE hprn) return printer->name; } +static HANDLE get_backend_handle( HANDLE hprn ) +{ + opened_printer_t *printer = get_opened_printer( hprn ); + if (!printer) return NULL; + return printer->backend_printer; +} + static DWORD open_printer_reg_key( const WCHAR *name, HKEY *key ) { HKEY printers; @@ -2904,10 +2911,19 @@ BOOL WINAPI AddFormA(HANDLE hPrinter, DWORD Level, LPBYTE pForm) /***************************************************************************** * AddFormW [WINSPOOL.@] */ -BOOL WINAPI AddFormW(HANDLE hPrinter, DWORD Level, LPBYTE pForm) +BOOL WINAPI AddFormW( HANDLE printer, DWORD level, BYTE *form ) { - FIXME("(%p,%d,%p): stub\n", hPrinter, Level, pForm); - return TRUE; + HANDLE handle = get_backend_handle( printer ); + + TRACE( "(%p, %d, %p)\n", printer, level, form ); + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + return backend->fpAddForm( handle, level, form ); } /***************************************************************************** @@ -3406,10 +3422,19 @@ BOOL WINAPI DeleteFormA(HANDLE hPrinter, LPSTR pFormName) /***************************************************************************** * DeleteFormW [WINSPOOL.@] */ -BOOL WINAPI DeleteFormW(HANDLE hPrinter, LPWSTR pFormName) +BOOL WINAPI DeleteFormW( HANDLE printer, WCHAR *name ) { - FIXME("(%p,%s): stub\n", hPrinter, debugstr_w(pFormName)); - return TRUE; + HANDLE handle = get_backend_handle( printer ); + + TRACE( "(%p, %s)\n", printer, debugstr_w( name ) ); + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + return backend->fpDeleteForm( handle, name ); } /***************************************************************************** @@ -3880,12 +3905,19 @@ BOOL WINAPI GetFormA(HANDLE hPrinter, LPSTR pFormName, DWORD Level, /***************************************************************************** * GetFormW [WINSPOOL.@] */ -BOOL WINAPI GetFormW(HANDLE hPrinter, LPWSTR pFormName, DWORD Level, - LPBYTE pForm, DWORD cbBuf, LPDWORD pcbNeeded) +BOOL WINAPI GetFormW( HANDLE printer, WCHAR *name, DWORD level, BYTE *form, DWORD size, DWORD *needed ) { - FIXME("(%p,%s,%d,%p,%d,%p): stub\n",hPrinter, - debugstr_w(pFormName),Level,pForm,cbBuf,pcbNeeded); - return FALSE; + HANDLE handle = get_backend_handle( printer ); + + TRACE( "(%p, %s, %d, %p, %d, %p)\n", printer, debugstr_w( name ), level, form, size, needed ); + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + return backend->fpGetForm( handle, name, level, form, size, needed ); } /***************************************************************************** @@ -3901,11 +3933,19 @@ BOOL WINAPI SetFormA(HANDLE hPrinter, LPSTR pFormName, DWORD Level, /***************************************************************************** * SetFormW [WINSPOOL.@] */ -BOOL WINAPI SetFormW(HANDLE hPrinter, LPWSTR pFormName, DWORD Level, - LPBYTE pForm) +BOOL WINAPI SetFormW( HANDLE printer, WCHAR *name, DWORD level, BYTE *form ) { - FIXME("(%p,%p,%d,%p): stub\n",hPrinter,pFormName,Level,pForm); - return FALSE; + HANDLE handle = get_backend_handle( printer ); + + TRACE( "(%p, %s, %d, %p)\n", printer, debugstr_w( name ), level, form ); + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + return backend->fpSetForm( handle, name, level, form ); } /***************************************************************************** @@ -7363,12 +7403,19 @@ BOOL WINAPI EnumFormsA( HANDLE hPrinter, DWORD Level, LPBYTE pForm, /****************************************************************************** * EnumFormsW (WINSPOOL.@) */ -BOOL WINAPI EnumFormsW( HANDLE hPrinter, DWORD Level, LPBYTE pForm, - DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned ) +BOOL WINAPI EnumFormsW( HANDLE printer, DWORD level, BYTE *form, DWORD size, DWORD *needed, DWORD *count ) { - FIXME("%p %x %p %x %p %p\n", hPrinter, Level, pForm, cbBuf, pcbNeeded, pcReturned); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + HANDLE handle = get_backend_handle( printer ); + + TRACE( "(%p, %d, %p, %d, %p, %p)\n", printer, level, form, size, needed, count ); + + if (!handle) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + + return backend->fpEnumForms( handle, level, form, size, needed, count ); } /*****************************************************************************
1
0
0
0
Huw Davies : include: Add winspool form string type defines.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: abb7d45129df865ff24208df6f29ad6904c0068c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=abb7d45129df865ff24208df…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed May 19 14:43:07 2021 +0100 include: Add winspool form string type defines. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winspool.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/winspool.h b/include/winspool.h index 4c170b861ef..68619741f38 100644 --- a/include/winspool.h +++ b/include/winspool.h @@ -135,6 +135,10 @@ extern "C" { #define FORM_BUILTIN 1 #define FORM_PRINTER 2 +#define STRING_NONE 1 +#define STRING_MUIDLL 2 +#define STRING_LANGPAIR 4 + #define PORT_TYPE_WRITE 1 #define PORT_TYPE_READ 2 #define PORT_TYPE_REDIRECTED 4
1
0
0
0
Piotr Caban : msvcrt: Import erf implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 9bc856dfaf80f9f69eb5b19f1c7f0159de58a630 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9bc856dfaf80f9f69eb5b19f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:39 2021 +0200 msvcrt: Import erf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 40 +++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 21 --------------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 39 insertions(+), 28 deletions(-) diff --git a/configure b/configure index 8e15b71d74e..ecfe7745900 100755 --- a/configure +++ b/configure @@ -19622,7 +19622,6 @@ for ac_func in \ asinhf \ atanh \ atanhf \ - erf \ exp2 \ exp2f \ expm1 \ diff --git a/configure.ac b/configure.ac index 90522c22867..c144fa1bbdd 100644 --- a/configure.ac +++ b/configure.ac @@ -2662,7 +2662,6 @@ AC_CHECK_FUNCS(\ asinhf \ atanh \ atanhf \ - erf \ exp2 \ exp2f \ expm1 \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 787bb18ddad..2e2161e91c4 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5304,7 +5304,45 @@ static double erfc2(uint32_t ix, double x) */ double CDECL erf(double x) { - return unix_funcs->erf( x ); + static const double efx8 = 1.02703333676410069053e+00, + pp0 = 1.28379167095512558561e-01, + pp1 = -3.25042107247001499370e-01, + pp2 = -2.84817495755985104766e-02, + pp3 = -5.77027029648944159157e-03, + pp4 = -2.37630166566501626084e-05, + qq1 = 3.97917223959155352819e-01, + qq2 = 6.50222499887672944485e-02, + qq3 = 5.08130628187576562776e-03, + qq4 = 1.32494738004321644526e-04, + qq5 = -3.96022827877536812320e-06; + + double r, s, z, y; + UINT32 ix; + int sign; + + ix = *(UINT64*)&x >> 32; + sign = ix >> 31; + ix &= 0x7fffffff; + if (ix >= 0x7ff00000) { + /* erf(nan)=nan, erf(+-inf)=+-1 */ + return 1 - 2 * sign + 1 / x; + } + if (ix < 0x3feb0000) { /* |x| < 0.84375 */ + if (ix < 0x3e300000) { /* |x| < 2**-28 */ + /* avoid underflow */ + return 0.125 * (8 * x + efx8 * x); + } + z = x * x; + r = pp0 + z * (pp1 + z * (pp2 + z * (pp3 + z * pp4))); + s = 1.0 + z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); + y = r / s; + return x + x * y; + } + if (ix < 0x40180000) /* 0.84375 <= |x| < 6 */ + y = 1 - erfc2(ix, x); + else + y = 1 - DBL_MIN; + return sign ? -y : y; } static float erfc1f(float x) diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 59f8ce4cee7..fd82c5afb94 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -153,26 +153,6 @@ static float CDECL unix_coshf( float x ) return coshf( x ); } -/********************************************************************* - * erf - */ -static double CDECL unix_erf(double x) -{ -#ifdef HAVE_ERF - return erf(x); -#else - /* Abramowitz and Stegun approximation, maximum error: 1.5*10^-7 */ - double t, y; - int sign = signbit(x); - - if (sign) x = -x; - t = 1 / (1 + 0.3275911 * x); - y = ((((1.061405429*t - 1.453152027)*t + 1.421413741)*t - 0.284496736)*t + 0.254829592)*t; - y = 1.0 - y*exp(-x*x); - return sign ? -y : y; -#endif -} - /********************************************************************* * exp */ @@ -541,7 +521,6 @@ static const struct unix_funcs funcs = unix_cosf, unix_cosh, unix_coshf, - unix_erf, unix_exp, unix_expf, unix_exp2, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 9793fca93bd..95b4a6488de 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -33,7 +33,6 @@ struct unix_funcs float (CDECL *cosf)(float x); double (CDECL *cosh)(double x); float (CDECL *coshf)(float x); - double (CDECL *erf)(double x); double (CDECL *exp)(double x); float (CDECL *expf)(float x); double (CDECL *exp2)(double x); diff --git a/include/config.h.in b/include/config.h.in index befb0af9f7e..74d54a942a6 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -110,9 +110,6 @@ /* Define to 1 if you have the `epoll_create' function. */ #undef HAVE_EPOLL_CREATE -/* Define to 1 if you have the `erf' function. */ -#undef HAVE_ERF - /* Define to 1 if you have the `exp2' function. */ #undef HAVE_EXP2
1
0
0
0
Piotr Caban : msvcrt: Import erfc implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 7b0e5b2b69cd4a3546d5a95bb77d89de54b83c6e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b0e5b2b69cd4a3546d5a95b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:33 2021 +0200 msvcrt: Import erfc implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 ----- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 -- 6 files changed, 127 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 9eb6cb7fd61..8e15b71d74e 100755 --- a/configure +++ b/configure @@ -19623,7 +19623,6 @@ for ac_func in \ atanh \ atanhf \ erf \ - erfc \ exp2 \ exp2f \ expm1 \ diff --git a/configure.ac b/configure.ac index d21882c7813..90522c22867 100644 --- a/configure.ac +++ b/configure.ac @@ -2663,7 +2663,6 @@ AC_CHECK_FUNCS(\ atanh \ atanhf \ erf \ - erfc \ exp2 \ exp2f \ expm1 \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index e0c28e25638..787bb18ddad 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5215,6 +5215,90 @@ short CDECL _fdtest(float *x) return _fdclass(*x); } +static double erfc1(double x) +{ + static const double erx = 8.45062911510467529297e-01, + pa0 = -2.36211856075265944077e-03, + pa1 = 4.14856118683748331666e-01, + pa2 = -3.72207876035701323847e-01, + pa3 = 3.18346619901161753674e-01, + pa4 = -1.10894694282396677476e-01, + pa5 = 3.54783043256182359371e-02, + pa6 = -2.16637559486879084300e-03, + qa1 = 1.06420880400844228286e-01, + qa2 = 5.40397917702171048937e-01, + qa3 = 7.18286544141962662868e-02, + qa4 = 1.26171219808761642112e-01, + qa5 = 1.36370839120290507362e-02, + qa6 = 1.19844998467991074170e-02; + + double s, P, Q; + + s = fabs(x) - 1; + P = pa0 + s * (pa1 + s * (pa2 + s * (pa3 + s * (pa4 + s * (pa5 + s * pa6))))); + Q = 1 + s * (qa1 + s * (qa2 + s * (qa3 + s * (qa4 + s * (qa5 + s * qa6))))); + return 1 - erx - P / Q; +} + +static double erfc2(uint32_t ix, double x) +{ + static const double ra0 = -9.86494403484714822705e-03, + ra1 = -6.93858572707181764372e-01, + ra2 = -1.05586262253232909814e+01, + ra3 = -6.23753324503260060396e+01, + ra4 = -1.62396669462573470355e+02, + ra5 = -1.84605092906711035994e+02, + ra6 = -8.12874355063065934246e+01, + ra7 = -9.81432934416914548592e+00, + sa1 = 1.96512716674392571292e+01, + sa2 = 1.37657754143519042600e+02, + sa3 = 4.34565877475229228821e+02, + sa4 = 6.45387271733267880336e+02, + sa5 = 4.29008140027567833386e+02, + sa6 = 1.08635005541779435134e+02, + sa7 = 6.57024977031928170135e+00, + sa8 = -6.04244152148580987438e-02, + rb0 = -9.86494292470009928597e-03, + rb1 = -7.99283237680523006574e-01, + rb2 = -1.77579549177547519889e+01, + rb3 = -1.60636384855821916062e+02, + rb4 = -6.37566443368389627722e+02, + rb5 = -1.02509513161107724954e+03, + rb6 = -4.83519191608651397019e+02, + sb1 = 3.03380607434824582924e+01, + sb2 = 3.25792512996573918826e+02, + sb3 = 1.53672958608443695994e+03, + sb4 = 3.19985821950859553908e+03, + sb5 = 2.55305040643316442583e+03, + sb6 = 4.74528541206955367215e+02, + sb7 = -2.24409524465858183362e+01; + + double s, R, S, z; + UINT64 iz; + + if (ix < 0x3ff40000) /* |x| < 1.25 */ + return erfc1(x); + + x = fabs(x); + s = 1 / (x * x); + if (ix < 0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ + R = ra0 + s * (ra1 + s * (ra2 + s * (ra3 + s * (ra4 + s * + (ra5 + s * (ra6 + s * ra7)))))); + S = 1.0 + s * (sa1 + s * (sa2 + s * (sa3 + s * (sa4 + s * + (sa5 + s * (sa6 + s * (sa7 + s * sa8))))))); + } else { /* |x| > 1/.35 */ + R = rb0 + s * (rb1 + s * (rb2 + s * (rb3 + s * (rb4 + s * + (rb5 + s * rb6))))); + S = 1.0 + s * (sb1 + s * (sb2 + s * (sb3 + s * (sb4 + s * + (sb5 + s * (sb6 + s * sb7)))))); + } + z = x; + iz = *(ULONGLONG*)&z; + iz &= 0xffffffff00000000ULL; + z = *(double*)&iz; + return exp(-z * z - 0.5625) * exp((z - x) * (z + x) + R / S) / x; +} + /********************************************************************* * erf (MSVCR120.@) */ @@ -5354,10 +5438,52 @@ float CDECL erff(float x) /********************************************************************* * erfc (MSVCR120.@) + * + * Copied from musl: src/math/erf.c */ double CDECL erfc(double x) { - return unix_funcs->erfc( x ); + static const double pp0 = 1.28379167095512558561e-01, + pp1 = -3.25042107247001499370e-01, + pp2 = -2.84817495755985104766e-02, + pp3 = -5.77027029648944159157e-03, + pp4 = -2.37630166566501626084e-05, + qq1 = 3.97917223959155352819e-01, + qq2 = 6.50222499887672944485e-02, + qq3 = 5.08130628187576562776e-03, + qq4 = 1.32494738004321644526e-04, + qq5 = -3.96022827877536812320e-06; + + double r, s, z, y; + UINT32 ix; + int sign; + + ix = *(ULONGLONG*)&x >> 32; + sign = ix >> 31; + ix &= 0x7fffffff; + if (ix >= 0x7ff00000) { + /* erfc(nan)=nan, erfc(+-inf)=0,2 */ + return 2 * sign + 1 / x; + } + if (ix < 0x3feb0000) { /* |x| < 0.84375 */ + if (ix < 0x3c700000) /* |x| < 2**-56 */ + return 1.0 - x; + z = x * x; + r = pp0 + z * (pp1 + z * (pp2 + z * (pp3 + z * pp4))); + s = 1.0 + z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); + y = r / s; + if (sign || ix < 0x3fd00000) { /* x < 1/4 */ + return 1.0 - (x + x * y); + } + return 0.5 - (x - 0.5 + x * y); + } + if (ix < 0x403c0000) { /* 0.84375 <= |x| < 28 */ + return sign ? 2 - erfc2(ix, x) : erfc2(ix, x); + } + if (sign) + return 2 - DBL_MIN; + *_errno() = ERANGE; + return fp_barrier(DBL_MIN) * DBL_MIN; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 9607ca94e7c..59f8ce4cee7 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -173,18 +173,6 @@ static double CDECL unix_erf(double x) #endif } -/********************************************************************* - * erfc - */ -static double CDECL unix_erfc(double x) -{ -#ifdef HAVE_ERFC - return erfc(x); -#else - return 1 - unix_erf(x); -#endif -} - /********************************************************************* * exp */ @@ -554,7 +542,6 @@ static const struct unix_funcs funcs = unix_cosh, unix_coshf, unix_erf, - unix_erfc, unix_exp, unix_expf, unix_exp2, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 58ec53d285c..9793fca93bd 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -34,7 +34,6 @@ struct unix_funcs double (CDECL *cosh)(double x); float (CDECL *coshf)(float x); double (CDECL *erf)(double x); - double (CDECL *erfc)(double x); double (CDECL *exp)(double x); float (CDECL *expf)(float x); double (CDECL *exp2)(double x); diff --git a/include/config.h.in b/include/config.h.in index b0e1fb55332..befb0af9f7e 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -113,9 +113,6 @@ /* Define to 1 if you have the `erf' function. */ #undef HAVE_ERF -/* Define to 1 if you have the `erfc' function. */ -#undef HAVE_ERFC - /* Define to 1 if you have the `exp2' function. */ #undef HAVE_EXP2
1
0
0
0
Piotr Caban : msvcrt: Import erff implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: 98525b04bc1de4c136d4fb0d70bdecaf0641f0e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=98525b04bc1de4c136d4fb0d…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:29 2021 +0200 msvcrt: Import erff implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 42 +++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 ------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 41 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 00c8378b4c6..9eb6cb7fd61 100755 --- a/configure +++ b/configure @@ -19624,7 +19624,6 @@ for ac_func in \ atanhf \ erf \ erfc \ - erff \ exp2 \ exp2f \ expm1 \ diff --git a/configure.ac b/configure.ac index e8b3d175fc9..d21882c7813 100644 --- a/configure.ac +++ b/configure.ac @@ -2664,7 +2664,6 @@ AC_CHECK_FUNCS(\ atanhf \ erf \ erfc \ - erff \ exp2 \ exp2f \ expm1 \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index bd4df691e58..e0c28e25638 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5306,10 +5306,50 @@ static float erfc2f(UINT32 ix, float x) /********************************************************************* * erff (MSVCR120.@) + * + * Copied from musl: src/math/erff.c */ float CDECL erff(float x) { - return unix_funcs->erff( x ); + static const float efx8 = 1.0270333290e+00, + pp0 = 1.2837916613e-01, + pp1 = -3.2504209876e-01, + pp2 = -2.8481749818e-02, + pp3 = -5.7702702470e-03, + pp4 = -2.3763017452e-05, + qq1 = 3.9791721106e-01, + qq2 = 6.5022252500e-02, + qq3 = 5.0813062117e-03, + qq4 = 1.3249473704e-04, + qq5 = -3.9602282413e-06; + + float r, s, z, y; + UINT32 ix; + int sign; + + ix = *(UINT32*)&x; + sign = ix >> 31; + ix &= 0x7fffffff; + if (ix >= 0x7f800000) { + /* erf(nan)=nan, erf(+-inf)=+-1 */ + return 1 - 2 * sign + 1 / x; + } + if (ix < 0x3f580000) { /* |x| < 0.84375 */ + if (ix < 0x31800000) { /* |x| < 2**-28 */ + /*avoid underflow */ + return 0.125f * (8 * x + efx8 * x); + } + z = x * x; + r = pp0 + z * (pp1 + z * (pp2 + z * (pp3 + z * pp4))); + s = 1 + z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); + y = r / s; + return x + x * y; + } + if (ix < 0x40c00000) /* |x| < 6 */ + y = 1 - erfc2f(ix, x); + else + y = 1 - FLT_MIN; + return sign ? -y : y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 77de4602918..9607ca94e7c 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -173,18 +173,6 @@ static double CDECL unix_erf(double x) #endif } -/********************************************************************* - * erff - */ -static float CDECL unix_erff(float x) -{ -#ifdef HAVE_ERFF - return erff(x); -#else - return unix_erf(x); -#endif -} - /********************************************************************* * erfc */ @@ -567,7 +555,6 @@ static const struct unix_funcs funcs = unix_coshf, unix_erf, unix_erfc, - unix_erff, unix_exp, unix_expf, unix_exp2, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 13912c68c99..58ec53d285c 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -35,7 +35,6 @@ struct unix_funcs float (CDECL *coshf)(float x); double (CDECL *erf)(double x); double (CDECL *erfc)(double x); - float (CDECL *erff)(float x); double (CDECL *exp)(double x); float (CDECL *expf)(float x); double (CDECL *exp2)(double x); diff --git a/include/config.h.in b/include/config.h.in index d7738888e27..b0e1fb55332 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -116,9 +116,6 @@ /* Define to 1 if you have the `erfc' function. */ #undef HAVE_ERFC -/* Define to 1 if you have the `erff' function. */ -#undef HAVE_ERFF - /* Define to 1 if you have the `exp2' function. */ #undef HAVE_EXP2
1
0
0
0
Piotr Caban : msvcrt: Import erfcf implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: de11fe6dcd7a816d6a2dd98310345227a7c08141 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de11fe6dcd7a816d6a2dd983…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:23 2021 +0200 msvcrt: Import erfcf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 ------ dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 -- 6 files changed, 124 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 44077d727fe..00c8378b4c6 100755 --- a/configure +++ b/configure @@ -19624,7 +19624,6 @@ for ac_func in \ atanhf \ erf \ erfc \ - erfcf \ erff \ exp2 \ exp2f \ diff --git a/configure.ac b/configure.ac index 56a4a75ac08..e8b3d175fc9 100644 --- a/configure.ac +++ b/configure.ac @@ -2664,7 +2664,6 @@ AC_CHECK_FUNCS(\ atanhf \ erf \ erfc \ - erfcf \ erff \ exp2 \ exp2f \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 8ac545ae758..bd4df691e58 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5223,6 +5223,87 @@ double CDECL erf(double x) return unix_funcs->erf( x ); } +static float erfc1f(float x) +{ + static const float erx = 8.4506291151e-01, + pa0 = -2.3621185683e-03, + pa1 = 4.1485610604e-01, + pa2 = -3.7220788002e-01, + pa3 = 3.1834661961e-01, + pa4 = -1.1089469492e-01, + pa5 = 3.5478305072e-02, + pa6 = -2.1663755178e-03, + qa1 = 1.0642088205e-01, + qa2 = 5.4039794207e-01, + qa3 = 7.1828655899e-02, + qa4 = 1.2617121637e-01, + qa5 = 1.3637083583e-02, + qa6 = 1.1984500103e-02; + + float s, P, Q; + + s = fabsf(x) - 1; + P = pa0 + s * (pa1 + s * (pa2 + s * (pa3 + s * (pa4 + s * (pa5 + s * pa6))))); + Q = 1 + s * (qa1 + s * (qa2 + s * (qa3 + s * (qa4 + s * (qa5 + s * qa6))))); + return 1 - erx - P / Q; +} + +static float erfc2f(UINT32 ix, float x) +{ + static const float ra0 = -9.8649440333e-03, + ra1 = -6.9385856390e-01, + ra2 = -1.0558626175e+01, + ra3 = -6.2375331879e+01, + ra4 = -1.6239666748e+02, + ra5 = -1.8460508728e+02, + ra6 = -8.1287437439e+01, + ra7 = -9.8143291473e+00, + sa1 = 1.9651271820e+01, + sa2 = 1.3765776062e+02, + sa3 = 4.3456588745e+02, + sa4 = 6.4538726807e+02, + sa5 = 4.2900814819e+02, + sa6 = 1.0863500214e+02, + sa7 = 6.5702495575e+00, + sa8 = -6.0424413532e-02, + rb0 = -9.8649431020e-03, + rb1 = -7.9928326607e-01, + rb2 = -1.7757955551e+01, + rb3 = -1.6063638306e+02, + rb4 = -6.3756646729e+02, + rb5 = -1.0250950928e+03, + rb6 = -4.8351919556e+02, + sb1 = 3.0338060379e+01, + sb2 = 3.2579251099e+02, + sb3 = 1.5367296143e+03, + sb4 = 3.1998581543e+03, + sb5 = 2.5530502930e+03, + sb6 = 4.7452853394e+02, + sb7 = -2.2440952301e+01; + + float s, R, S, z; + + if (ix < 0x3fa00000) /* |x| < 1.25 */ + return erfc1f(x); + + x = fabsf(x); + s = 1 / (x * x); + if (ix < 0x4036db6d) { /* |x| < 1/0.35 */ + R = ra0 + s * (ra1 + s * (ra2 + s * (ra3 + s * (ra4 + s * + (ra5 + s * (ra6 + s * ra7)))))); + S = 1.0f + s * (sa1 + s * (sa2 + s * (sa3 + s * (sa4 + s * + (sa5 + s * (sa6 + s * (sa7 + s * sa8))))))); + } else { /* |x| >= 1/0.35 */ + R = rb0 + s * (rb1 + s * (rb2 + s * (rb3 + s * (rb4 + s * (rb5 + s * rb6))))); + S = 1.0f + s * (sb1 + s * (sb2 + s * (sb3 + s * (sb4 + s * + (sb5 + s * (sb6 + s * sb7)))))); + } + + ix = *(UINT32*)&x & 0xffffe000; + z = *(float*)&ix; + return expf(-z * z - 0.5625f) * expf((z - x) * (z + x) + R / S) / x; +} + /********************************************************************* * erff (MSVCR120.@) */ @@ -5241,10 +5322,52 @@ double CDECL erfc(double x) /********************************************************************* * erfcf (MSVCR120.@) + * + * Copied from musl: src/math/erff.c */ float CDECL erfcf(float x) { - return unix_funcs->erfcf( x ); + static const float pp0 = 1.2837916613e-01, + pp1 = -3.2504209876e-01, + pp2 = -2.8481749818e-02, + pp3 = -5.7702702470e-03, + pp4 = -2.3763017452e-05, + qq1 = 3.9791721106e-01, + qq2 = 6.5022252500e-02, + qq3 = 5.0813062117e-03, + qq4 = 1.3249473704e-04, + qq5 = -3.9602282413e-06; + + float r, s, z, y; + UINT32 ix; + int sign; + + ix = *(UINT32*)&x; + sign = ix >> 31; + ix &= 0x7fffffff; + if (ix >= 0x7f800000) { + /* erfc(nan)=nan, erfc(+-inf)=0,2 */ + return 2 * sign + 1 / x; + } + + if (ix < 0x3f580000) { /* |x| < 0.84375 */ + if (ix < 0x23800000) /* |x| < 2**-56 */ + return 1.0f - x; + z = x * x; + r = pp0 + z * (pp1 + z * (pp2 + z * (pp3 + z * pp4))); + s = 1.0f + z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); + y = r / s; + if (sign || ix < 0x3e800000) /* x < 1/4 */ + return 1.0f - (x + x * y); + return 0.5f - (x - 0.5f + x * y); + } + if (ix < 0x41e00000) { /* |x| < 28 */ + return sign ? 2 - erfc2f(ix, x) : erfc2f(ix, x); + } + if (sign) + return 2 - FLT_MIN; + *_errno() = ERANGE; + return FLT_MIN * FLT_MIN; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index da253d9b55c..77de4602918 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -197,18 +197,6 @@ static double CDECL unix_erfc(double x) #endif } -/********************************************************************* - * erfcf - */ -static float CDECL unix_erfcf(float x) -{ -#ifdef HAVE_ERFCF - return erfcf(x); -#else - return unix_erfc(x); -#endif -} - /********************************************************************* * exp */ @@ -579,7 +567,6 @@ static const struct unix_funcs funcs = unix_coshf, unix_erf, unix_erfc, - unix_erfcf, unix_erff, unix_exp, unix_expf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 84e62fd133a..13912c68c99 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -35,7 +35,6 @@ struct unix_funcs float (CDECL *coshf)(float x); double (CDECL *erf)(double x); double (CDECL *erfc)(double x); - float (CDECL *erfcf)(float x); float (CDECL *erff)(float x); double (CDECL *exp)(double x); float (CDECL *expf)(float x); diff --git a/include/config.h.in b/include/config.h.in index 72e981821da..d7738888e27 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -116,9 +116,6 @@ /* Define to 1 if you have the `erfc' function. */ #undef HAVE_ERFC -/* Define to 1 if you have the `erfcf' function. */ -#undef HAVE_ERFCF - /* Define to 1 if you have the `erff' function. */ #undef HAVE_ERFF
1
0
0
0
Piotr Caban : msvcrt: Import remainderf implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: b48e80a520af5720adc46a39cfa724a7f3ae45f4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b48e80a520af5720adc46a39…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:21 2021 +0200 msvcrt: Import remainderf implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 11 +++++++---- dlls/msvcrt/unixlib.c | 14 -------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 7 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 827d17d7500..44077d727fe 100755 --- a/configure +++ b/configure @@ -19638,7 +19638,6 @@ for ac_func in \ log1pf \ log2 \ log2f \ - remainderf \ tgamma \ tgammaf diff --git a/configure.ac b/configure.ac index 8b319923816..56a4a75ac08 100644 --- a/configure.ac +++ b/configure.ac @@ -2678,7 +2678,6 @@ AC_CHECK_FUNCS(\ log1pf \ log2 \ log2f \ - remainderf \ tgamma \ tgammaf ) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 6c856700f94..8ac545ae758 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5488,13 +5488,16 @@ double CDECL remainder(double x, double y) /********************************************************************* * remainderf (MSVCR120.@) + * + * Copied from musl: src/math/remainderf.c */ float CDECL remainderf(float x, float y) { - /* this matches 64-bit Windows. 32-bit Windows is slightly different */ - if(!isfinite(x)) *_errno() = EDOM; - if(isnan(y) || y==0.0f) *_errno() = EDOM; - return unix_funcs->remainderf( x, y ); + int q; +#if _MSVCR_VER == 120 && defined(__x86_64__) + if (isnan(x) || isnan(y)) *_errno() = EDOM; +#endif + return remquof(x, y, &q); } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index b1f824f4c72..da253d9b55c 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -475,19 +475,6 @@ static float CDECL unix_powf( float x, float y ) return powf( x, y ); } -/********************************************************************* - * remainderf - */ -static float CDECL unix_remainderf(float x, float y) -{ -#ifdef HAVE_REMAINDERF - return remainderf(x, y); -#else - FIXME( "not implemented\n" ); - return 0; -#endif -} - /********************************************************************* * sin */ @@ -621,7 +608,6 @@ static const struct unix_funcs funcs = unix_logbf, unix_pow, unix_powf, - unix_remainderf, unix_sin, unix_sinf, unix_sinh, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index d301a9716cf..84e62fd133a 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -64,7 +64,6 @@ struct unix_funcs float (CDECL *logbf)(float x); double (CDECL *pow)(double x, double y); float (CDECL *powf)(float x, float y); - float (CDECL *remainderf)(float x, float y); double (CDECL *sin)(double x); float (CDECL *sinf)(float x); double (CDECL *sinh)(double x); diff --git a/include/config.h.in b/include/config.h.in index 58325f3df92..72e981821da 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -630,9 +630,6 @@ /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK -/* Define to 1 if you have the `remainderf' function. */ -#undef HAVE_REMAINDERF - /* Define to 1 if the system has the type `request_sense'. */ #undef HAVE_REQUEST_SENSE
1
0
0
0
Piotr Caban : msvcrt: Import remainder implementation from musl.
by Alexandre Julliard
19 May '21
19 May '21
Module: wine Branch: master Commit: fd22e3b61be20545e2e51b3c70e0346f03f3e04b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd22e3b61be20545e2e51b3c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed May 19 15:26:17 2021 +0200 msvcrt: Import remainder implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 11 +++++++---- dlls/msvcrt/unixlib.c | 14 -------------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- include/msvcrt/math.h | 2 ++ 7 files changed, 9 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 0ec898ca762..827d17d7500 100755 --- a/configure +++ b/configure @@ -19638,7 +19638,6 @@ for ac_func in \ log1pf \ log2 \ log2f \ - remainder \ remainderf \ tgamma \ tgammaf diff --git a/configure.ac b/configure.ac index 72db35563e7..8b319923816 100644 --- a/configure.ac +++ b/configure.ac @@ -2678,7 +2678,6 @@ AC_CHECK_FUNCS(\ log1pf \ log2 \ log2f \ - remainder \ remainderf \ tgamma \ tgammaf diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index ae3b9aa76e6..6c856700f94 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5474,13 +5474,16 @@ float CDECL _scalbf(float num, __msvcrt_long power) /********************************************************************* * remainder (MSVCR120.@) + * + * Copied from musl: src/math/remainder.c */ double CDECL remainder(double x, double y) { - /* this matches 64-bit Windows. 32-bit Windows is slightly different */ - if(!isfinite(x)) *_errno() = EDOM; - if(isnan(y) || y==0.0) *_errno() = EDOM; - return unix_funcs->remainder( x, y ); + int q; +#if _MSVCR_VER == 120 && defined(__x86_64__) + if (isnan(x) || isnan(y)) *_errno() = EDOM; +#endif + return remquo(x, y, &q); } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index cd22d36acb4..b1f824f4c72 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -475,19 +475,6 @@ static float CDECL unix_powf( float x, float y ) return powf( x, y ); } -/********************************************************************* - * remainder - */ -static double CDECL unix_remainder(double x, double y) -{ -#ifdef HAVE_REMAINDER - return remainder(x, y); -#else - FIXME( "not implemented\n" ); - return 0; -#endif -} - /********************************************************************* * remainderf */ @@ -634,7 +621,6 @@ static const struct unix_funcs funcs = unix_logbf, unix_pow, unix_powf, - unix_remainder, unix_remainderf, unix_sin, unix_sinf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index f71ceea1cab..d301a9716cf 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -64,7 +64,6 @@ struct unix_funcs float (CDECL *logbf)(float x); double (CDECL *pow)(double x, double y); float (CDECL *powf)(float x, float y); - double (CDECL *remainder)(double x, double y); float (CDECL *remainderf)(float x, float y); double (CDECL *sin)(double x); float (CDECL *sinf)(float x); diff --git a/include/config.h.in b/include/config.h.in index 1d54a041ce2..58325f3df92 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -630,9 +630,6 @@ /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK -/* Define to 1 if you have the `remainder' function. */ -#undef HAVE_REMAINDER - /* Define to 1 if you have the `remainderf' function. */ #undef HAVE_REMAINDERF diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index d2977b67c34..d4db618f542 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -73,6 +73,8 @@ _ACRTIMP double __cdecl fmod(double, double); _ACRTIMP double __cdecl fmin(double, double); _ACRTIMP double __cdecl fmax(double, double); _ACRTIMP double __cdecl erf(double); +_ACRTIMP double __cdecl remquo(double, double, int*); +_ACRTIMP float __cdecl remquof(float, float, int*); _ACRTIMP double __cdecl _hypot(double, double); _ACRTIMP double __cdecl _j0(double);
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200