Skip to content

Commit 7381ffd

Browse files
committed
[MSVC-MingW] Include correct header for compiler intrinsics
1 parent b27722a commit 7381ffd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

portable/MSVC-MingW/portmacro.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,25 @@ void vPortExitCritical( void );
145145
: "cc" )
146146

147147
#else /* __GNUC__ */
148+
#include <intrin.h>
148149

149150
/* BitScanReverse returns the bit position of the most significant '1'
150151
* in the word. */
151152
#if defined( __x86_64__ ) || defined( _M_X64 )
153+
#pragma intrinsic(_BitScanReverse64)
152154

153155
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
154156
do \
155157
{ \
156-
DWORD ulTopPriority; \
158+
unsigned long ulTopPriority; \
157159
_BitScanReverse64( &ulTopPriority, ( uxReadyPriorities ) ); \
158160
uxTopPriority = ulTopPriority; \
159161
} while( 0 )
160162

161163
#else /* #if defined( __x86_64__ ) || defined( _M_X64 ) */
164+
#pragma intrinsic(_BitScanReverse)
162165

163-
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) _BitScanReverse( ( DWORD * ) &( uxTopPriority ), ( uxReadyPriorities ) )
166+
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) _BitScanReverse( ( unsigned long * ) &( uxTopPriority ), ( uxReadyPriorities ) )
164167

165168
#endif /* #if defined( __x86_64__ ) || defined( _M_X64 ) */
166169

0 commit comments

Comments
 (0)