Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c6d67fad
Commit
c6d67fad
authored
Dec 01, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Feb 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: sizeof(long double) is 12 with MS, but not necessarily so on UNIX.
parent
4dc81b65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-1
string.c
dlls/msvcrt/string.c
+15
-5
No files found.
dlls/msvcrt/msvcrt.h
View file @
c6d67fad
...
...
@@ -86,7 +86,7 @@ typedef int (*__cdecl MSVCRT__onexit_t)(void);
typedef
void
(
__cdecl
*
MSVCRT_invalid_parameter_handler
)(
const
MSVCRT_wchar_t
*
,
const
MSVCRT_wchar_t
*
,
const
MSVCRT_wchar_t
*
,
unsigned
,
MSVCRT_uintptr_t
);
typedef
void
(
__cdecl
*
MSVCRT_purecall_handler
)(
void
);
typedef
struct
{
long
double
x
;}
MSVCRT__LDOUBLE
;
typedef
struct
{
ULONG
x80
[
3
];}
MSVCRT__LDOUBLE
;
/* Intel 80 bit FP format has sizeof() 12 */
struct
MSVCRT_tm
{
int
tm_sec
;
...
...
dlls/msvcrt/string.c
View file @
c6d67fad
...
...
@@ -561,8 +561,10 @@ int CDECL MSVCRT__atoldbl(MSVCRT__LDOUBLE *value, const char *str)
{
/* FIXME needs error checking for huge/small values */
#ifdef HAVE_STRTOLD
long
double
ld
;
TRACE
(
"str %s value %p
\n
"
,
str
,
value
);
value
->
x
=
strtold
(
str
,
0
);
ld
=
strtold
(
str
,
0
);
memcpy
(
value
,
&
ld
,
10
);
#else
FIXME
(
"stub, str %s value %p
\n
"
,
str
,
value
);
#endif
...
...
@@ -575,8 +577,10 @@ int CDECL MSVCRT__atoldbl(MSVCRT__LDOUBLE *value, const char *str)
int
CDECL
__STRINGTOLD
(
MSVCRT__LDOUBLE
*
value
,
char
**
endptr
,
const
char
*
str
,
int
flags
)
{
#ifdef HAVE_STRTOLD
long
double
ld
;
FIXME
(
"%p %p %s %x partial stub
\n
"
,
value
,
endptr
,
str
,
flags
);
value
->
x
=
strtold
(
str
,
endptr
);
ld
=
strtold
(
str
,
0
);
memcpy
(
value
,
&
ld
,
10
);
#else
FIXME
(
"%p %p %s %x stub
\n
"
,
value
,
endptr
,
str
,
flags
);
#endif
...
...
@@ -1281,7 +1285,7 @@ struct _I10_OUTPUT_DATA {
/*********************************************************************
* $I10_OUTPUT (MSVCRT.@)
* ld
- long double
to be printed to data
* ld
80 - long double (Intel 80 bit FP in 12 bytes)
to be printed to data
* prec - precision of part, we're interested in
* flag - 0 for first prec digits, 1 for fractional part
* data - data to be populated
...
...
@@ -1294,16 +1298,22 @@ struct _I10_OUTPUT_DATA {
* Native sets last byte of data->str to '0' or '9', I don't know what
* it means. Current implementation sets it always to '0'.
*/
int
CDECL
MSVCRT_I10_OUTPUT
(
MSVCRT__LDOUBLE
ld
,
int
prec
,
int
flag
,
struct
_I10_OUTPUT_DATA
*
data
)
int
CDECL
MSVCRT_I10_OUTPUT
(
MSVCRT__LDOUBLE
ld
80
,
int
prec
,
int
flag
,
struct
_I10_OUTPUT_DATA
*
data
)
{
static
const
char
inf_str
[]
=
"1#INF"
;
static
const
char
nan_str
[]
=
"1#QNAN"
;
double
d
=
ld
.
x
;
/* MS' long double type wants 12 bytes for Intel's 80 bit FP format.
* Some UNIX have sizeof(long double) == 16, yet only 80 bit are used.
* Assume long double uses 80 bit FP, never seen 128 bit FP. */
long
double
ld
=
0
;
double
d
;
char
format
[
8
];
char
buf
[
I10_OUTPUT_MAX_PREC
+
9
];
/* 9 = strlen("0.e+0000") + '\0' */
char
*
p
;
memcpy
(
&
ld
,
&
ld80
,
10
);
d
=
ld
;
TRACE
(
"(%lf %d %x %p)
\n
"
,
d
,
prec
,
flag
,
data
);
if
(
d
<
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment