* Support for intrinsics in MSW + Clang scenario.

Utility polyfill is provided, removed the no-longer-needed
conditionals.
This commit is contained in:
Vladislav Dmitrievich Turbanov 2021-04-02 12:05:45 +03:00 committed by Sam Lantinga
parent 89b6209313
commit 50db4a59b8
3 changed files with 38 additions and 14 deletions

View file

@ -30,7 +30,23 @@
#include "SDL_stdinc.h"
#if defined(_MSC_VER) && !defined(__clang__)
#ifdef _MSC_VER
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
#ifdef __clang__
#ifndef __PRFCHWINTRIN_H
#define __PRFCHWINTRIN_H
static __inline__ void __attribute__((__always_inline__, __nodebug__))
_m_prefetch(void *__P)
{
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
}
#endif /* __PRFCHWINTRIN_H */
#endif /* __clang__ */
#include <intrin.h>
#endif