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
72c4adc0
Commit
72c4adc0
authored
Jan 15, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Avoid defining intrinsic functions as inline.
Now clang provides intrinsic variant of Interlocked*64 family on i386 machine. Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
8536af68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
22 deletions
+36
-22
winnt.h
include/winnt.h
+36
-22
No files found.
include/winnt.h
View file @
72c4adc0
...
@@ -6745,6 +6745,10 @@ typedef enum _FIRMWARE_TYPE
...
@@ -6745,6 +6745,10 @@ typedef enum _FIRMWARE_TYPE
FirmwareTypeMax
FirmwareTypeMax
}
FIRMWARE_TYPE
,
*
PFIRMWARE_TYPE
;
}
FIRMWARE_TYPE
,
*
PFIRMWARE_TYPE
;
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
/* Intrinsic functions */
/* Intrinsic functions */
#define BitScanForward _BitScanForward
#define BitScanForward _BitScanForward
...
@@ -6809,63 +6813,73 @@ long _InterlockedOr(long volatile *,long);
...
@@ -6809,63 +6813,73 @@ long _InterlockedOr(long volatile *,long);
long
_InterlockedXor
(
long
volatile
*
,
long
);
long
_InterlockedXor
(
long
volatile
*
,
long
);
DECLSPEC_NORETURN
void
__fastfail
(
unsigned
int
);
DECLSPEC_NORETURN
void
__fastfail
(
unsigned
int
);
#ifndef __i386__
#if !defined(__i386__) || __has_builtin(_InterlockedAnd64)
#pragma intrinsic(_InterlockedAnd64)
#pragma intrinsic(_InterlockedAnd64)
#pragma intrinsic(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic(_InterlockedIncrement64)
#pragma intrinsic(_InterlockedOr64)
#pragma intrinsic(_InterlockedXor64)
__int64
_InterlockedAnd64
(
__int64
volatile
*
,
__int64
);
__int64
_InterlockedAnd64
(
__int64
volatile
*
,
__int64
);
__int64
_InterlockedDecrement64
(
__int64
volatile
*
);
__int64
_InterlockedExchangeAdd64
(
__int64
volatile
*
,
__int64
);
__int64
_InterlockedIncrement64
(
__int64
volatile
*
);
__int64
_InterlockedOr64
(
__int64
volatile
*
,
__int64
);
__int64
_InterlockedXor64
(
__int64
volatile
*
,
__int64
);
#else
#else
static
FORCEINLINE
__int64
InterlockedAnd64
(
__int64
volatile
*
dest
,
__int64
val
)
static
FORCEINLINE
__int64
InterlockedAnd64
(
__int64
volatile
*
dest
,
__int64
val
)
{
{
__int64
prev
;
__int64
prev
;
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
&
val
,
prev
)
!=
prev
);
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
&
val
,
prev
)
!=
prev
);
return
prev
;
return
prev
;
}
}
#endif
#if !defined(__i386__) || __has_builtin(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedDecrement64)
__int64
_InterlockedDecrement64
(
__int64
volatile
*
);
#else
static
FORCEINLINE
__int64
InterlockedDecrement64
(
__int64
volatile
*
dest
)
{
return
InterlockedExchangeAdd64
(
dest
,
-
1
)
-
1
;
}
#endif
#if !defined(__i386__) || __has_builtin(_InterlockedExchangeAdd64)
#pragma intrinsic(_InterlockedExchangeAdd64)
__int64
_InterlockedExchangeAdd64
(
__int64
volatile
*
,
__int64
);
#else
static
FORCEINLINE
__int64
InterlockedExchangeAdd64
(
__int64
volatile
*
dest
,
__int64
val
)
static
FORCEINLINE
__int64
InterlockedExchangeAdd64
(
__int64
volatile
*
dest
,
__int64
val
)
{
{
__int64
prev
;
__int64
prev
;
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
+
val
,
prev
)
!=
prev
);
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
+
val
,
prev
)
!=
prev
);
return
prev
;
return
prev
;
}
}
#endif
#if !defined(__i386__) || __has_builtin(_InterlockedIncrement64)
#pragma intrinsic(_InterlockedIncrement64)
__int64
_InterlockedIncrement64
(
__int64
volatile
*
);
#else
static
FORCEINLINE
__int64
InterlockedIncrement64
(
__int64
volatile
*
dest
)
static
FORCEINLINE
__int64
InterlockedIncrement64
(
__int64
volatile
*
dest
)
{
{
return
InterlockedExchangeAdd64
(
dest
,
1
)
+
1
;
return
InterlockedExchangeAdd64
(
dest
,
1
)
+
1
;
}
}
#endif
static
FORCEINLINE
__int64
InterlockedDecrement64
(
__int64
volatile
*
dest
)
#if !defined(__i386__) || __has_builtin(_InterlockedOr64)
{
#pragma intrinsic(_InterlockedOr64)
return
InterlockedExchangeAdd64
(
dest
,
-
1
)
-
1
;
__int64
_InterlockedOr64
(
__int64
volatile
*
,
__int64
);
}
#else
static
FORCEINLINE
__int64
InterlockedOr64
(
__int64
volatile
*
dest
,
__int64
val
)
static
FORCEINLINE
__int64
InterlockedOr64
(
__int64
volatile
*
dest
,
__int64
val
)
{
{
__int64
prev
;
__int64
prev
;
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
|
val
,
prev
)
!=
prev
);
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
|
val
,
prev
)
!=
prev
);
return
prev
;
return
prev
;
}
}
#endif
#if !defined(__i386__) || __has_builtin(_InterlockedXor64)
#pragma intrinsic(_InterlockedXor64)
__int64
_InterlockedXor64
(
__int64
volatile
*
,
__int64
);
#else
static
FORCEINLINE
__int64
InterlockedXor64
(
__int64
volatile
*
dest
,
__int64
val
)
static
FORCEINLINE
__int64
InterlockedXor64
(
__int64
volatile
*
dest
,
__int64
val
)
{
{
__int64
prev
;
__int64
prev
;
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
^
val
,
prev
)
!=
prev
);
do
prev
=
*
dest
;
while
(
InterlockedCompareExchange64
(
dest
,
prev
^
val
,
prev
)
!=
prev
);
return
prev
;
return
prev
;
}
}
#endif
#endif
/* __i386__ */
static
FORCEINLINE
long
InterlockedAdd
(
long
volatile
*
dest
,
long
val
)
static
FORCEINLINE
long
InterlockedAdd
(
long
volatile
*
dest
,
long
val
)
{
{
...
...
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