Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a16ef96d
Commit
a16ef96d
authored
May 30, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include/msvcrt: Add INFINITY and NAN definitions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d535df42
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
28 additions
and
179 deletions
+28
-179
effect.c
dlls/d3dx9_36/tests/effect.c
+0
-19
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+1
-14
msvcp120.c
dlls/msvcp120/tests/msvcp120.c
+0
-14
misc.c
dlls/msvcp90/tests/misc.c
+0
-14
msvcr120.c
dlls/msvcr120/tests/msvcr120.c
+1
-24
misc.c
dlls/msvcrt/tests/misc.c
+0
-14
printf.c
dlls/msvcrt/tests/printf.c
+2
-15
misc.c
dlls/ucrtbase/tests/misc.c
+1
-14
printf.c
dlls/ucrtbase/tests/printf.c
+1
-14
string.c
dlls/ucrtbase/tests/string.c
+0
-18
writer.c
dlls/webservices/tests/writer.c
+1
-19
math.h
include/msvcrt/math.h
+12
-0
test.h
include/wine/test.h
+9
-0
No files found.
dlls/d3dx9_36/tests/effect.c
View file @
a16ef96d
...
...
@@ -22,25 +22,6 @@
#include "wine/test.h"
#include "d3dx9.h"
#ifndef INFINITY
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
#endif
/* INFINITY */
#ifndef NAN
static
float
get_nan
(
void
)
{
DWORD
nan
=
0x7fc00000
;
return
*
(
float
*
)
&
nan
;
}
#define NAN get_nan()
#endif
/* helper functions */
static
BOOL
compare_float
(
FLOAT
f
,
FLOAT
g
,
UINT
ulps
)
{
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
a16ef96d
...
...
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <float.h>
#include <math.h>
#include <io.h>
#include <stdio.h>
#include <windef.h>
...
...
@@ -180,20 +181,6 @@ typedef struct {
exception
e
;
}
logic_error
;
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
#undef __thiscall
#ifdef __i386__
#define __thiscall __stdcall
...
...
dlls/msvcp120/tests/msvcp120.c
View file @
a16ef96d
...
...
@@ -169,20 +169,6 @@ static void init_thiscall_thunk(void)
#define call_func7(func,_this,a,b,c,d,e,f) func(_this,a,b,c,d,e,f)
#endif
/* __i386__ */
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
typedef
int
MSVCRT_long
;
typedef
unsigned
char
MSVCP_bool
;
...
...
dlls/msvcp90/tests/misc.c
View file @
a16ef96d
...
...
@@ -27,20 +27,6 @@
#include <winbase.h>
#include "wine/test.h"
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
float
__port_ind
(
void
)
{
static
const
unsigned
__ind_bytes
=
0xffc00000
;
...
...
dlls/msvcr120/tests/msvcr120.c
View file @
a16ef96d
...
...
@@ -22,6 +22,7 @@
#include <wchar.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <wctype.h>
...
...
@@ -114,30 +115,6 @@ typedef struct {
critical_section
lock
;
}
_Condition_variable
;
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
int
isnormal
(
double
d
)
{
return
_fpclass
(
d
)
&
(
_FPCLASS_PN
|
_FPCLASS_NN
);
}
static
inline
int
isinf
(
double
d
)
{
return
_fpclass
(
d
)
&
(
_FPCLASS_PINF
|
_FPCLASS_NINF
);
}
struct
MSVCRT_lconv
{
char
*
decimal_point
;
...
...
dlls/msvcrt/tests/misc.c
View file @
a16ef96d
...
...
@@ -25,20 +25,6 @@
#include "msvcrt.h"
#include <process.h>
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
BOOL
almost_equal
(
double
d1
,
double
d2
)
{
if
(
d1
-
d2
>-
1e-30
&&
d1
-
d2
<
1e-30
)
return
TRUE
;
...
...
dlls/msvcrt/tests/printf.c
View file @
a16ef96d
...
...
@@ -24,9 +24,10 @@
* the following macro is defined.
*/
#define _CRT_NON_CONFORMING_SWPRINTFS
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <locale.h>
#include "windef.h"
...
...
@@ -35,20 +36,6 @@
#include "wine/test.h"
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
float
__port_ind
(
void
)
{
static
const
unsigned
__ind_bytes
=
0xffc00000
;
...
...
dlls/ucrtbase/tests/misc.c
View file @
a16ef96d
...
...
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <io.h>
#include <sys/stat.h>
...
...
@@ -57,20 +58,6 @@
expect_ ## func = called_ ## func = FALSE; \
}while(0)
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
double
__port_min_pos_double
(
void
)
{
static
const
UINT64
__min_pos_double
=
0x10000000000000
;
...
...
dlls/ucrtbase/tests/printf.c
View file @
a16ef96d
...
...
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -66,20 +67,6 @@ DEFINE_EXPECT(invalid_parameter_handler);
#define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
#define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
static
inline
float
__port_ind
(
void
)
{
static
const
unsigned
__ind_bytes
=
0xffc00000
;
...
...
dlls/ucrtbase/tests/string.c
View file @
a16ef96d
...
...
@@ -57,24 +57,6 @@ DEFINE_EXPECT(invalid_parameter_handler);
static
_invalid_parameter_handler
(
__cdecl
*
p_set_invalid_parameter_handler
)(
_invalid_parameter_handler
);
#ifndef INFINITY
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
#endif
#ifndef NAN
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
#endif
static
void
__cdecl
test_invalid_parameter_handler
(
const
wchar_t
*
expression
,
const
wchar_t
*
function
,
const
wchar_t
*
file
,
unsigned
line
,
uintptr_t
arg
)
...
...
dlls/webservices/tests/writer.c
View file @
a16ef96d
...
...
@@ -17,30 +17,12 @@
*/
#include <stdio.h>
#include <math.h>
#include "windows.h"
#include "rpc.h"
#include "webservices.h"
#include "wine/test.h"
#include <math.h>
#ifndef INFINITY
static
inline
float
__port_infinity
(
void
)
{
static
const
unsigned
__inf_bytes
=
0x7f800000
;
return
*
(
const
float
*
)
&
__inf_bytes
;
}
#define INFINITY __port_infinity()
#endif
#ifndef NAN
static
inline
float
__port_nan
(
void
)
{
static
const
unsigned
__nan_bytes
=
0x7fc00000
;
return
*
(
const
float
*
)
&
__nan_bytes
;
}
#define NAN __port_nan()
#endif
static
HRESULT
set_output
(
WS_XML_WRITER
*
writer
)
{
WS_XML_WRITER_TEXT_ENCODING
text
=
{
{
WS_XML_WRITER_ENCODING_TYPE_TEXT
},
WS_CHARSET_UTF8
};
...
...
include/msvcrt/math.h
View file @
a16ef96d
...
...
@@ -205,6 +205,18 @@ static const union {
# endif
#endif
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define INFINITY __builtin_inff()
# define NAN __builtin_nanf("")
#else
static
const
union
{
unsigned
int
__i
;
float
__f
;
}
__inff
=
{
0x7f800000
},
__nanf
=
{
0x7fc00000
};
# define INFINITY (__inff.__f)
# define NAN (__nanf.__f)
#endif
#define FP_INFINITE 1
#define FP_NAN 2
#define FP_NORMAL -1
...
...
include/wine/test.h
View file @
a16ef96d
...
...
@@ -46,6 +46,15 @@
#define INVALID_SET_FILE_POINTER (~0u)
#endif
#ifdef _MSC_VER
# ifndef INFINITY
# define INFINITY ((float)HUGE_VAL)
# endif
# ifndef NAN
# define NAN (INFINITY * 0.0f)
# endif
#endif
/* debug level */
extern
int
winetest_debug
;
...
...
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