Skip to content

Commit

Permalink
Fixed bug 5539 - Clang 11 fails to compile a CMake build with conflic…
Browse files Browse the repository at this point in the history
…ting types for _m_prefetchw

vladius

In SDL_cpuinfo.h it seems like <intrin.h> is not included when __clang__ is defined, as the comment in the file explicitly reads:
"Many of the intrinsics SDL uses are not implemented by clang with Visual Studio"

However, the SDL_endian.h header does include <intrin.h> without any precautions like:
>#ifdef _MSC_VER
>#include <intrin.h>
>#endif

Maybe it should be changed to something like:
>#ifdef _MSC_VER
>#ifndef __clang__
>#include <intrin.h>
>#endif
>#endif
  • Loading branch information
slouken committed Feb 10, 2021
1 parent 629334f commit ef52560
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/SDL_endian.h
Expand Up @@ -30,7 +30,7 @@

#include "SDL_stdinc.h"

#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
#include <intrin.h>
#endif

Expand Down

0 comments on commit ef52560

Please sign in to comment.