Fixed bug 5539 - Clang 11 fails to compile a CMake build with conflicting 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
3 # Build Universal binaries on Mac OS X, thanks Ryan!
5 # Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf x86 x64
7 DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
9 # Intel 32-bit compiler flags (10.6 runtime compatibility)
10 GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.6 \
13 GCC_LINK_X86="-mmacosx-version-min=10.6"
15 # Intel 64-bit compiler flags (10.6 runtime compatibility)
16 GCC_COMPILE_X64="gcc -arch x86_64 -mmacosx-version-min=10.6 \
17 -DMAC_OS_X_VERSION_MIN_REQUIRED=1060 \
20 GCC_LINK_X64="-mmacosx-version-min=10.6"
22 # Output both PowerPC and Intel object files
26 while test x$1 != x; do
28 --version) exec gcc $1;;
31 -print-prog-name=*) exec gcc $1;;
32 -print-search-dirs) exec gcc $1;;
33 -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
34 GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
38 *.c|*.cc|*.cpp|*.S|*.m|*.mm) source=$1;;
42 if test x$link = xyes; then
43 GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
44 GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
46 if test x"$output" = x; then
47 if test x$link = xyes; then
49 elif test x$compile = xyes; then
50 output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o
55 if test x"$output" != x; then
56 dir=x86/`dirname $output`
64 while test x$1 != x; do
65 if test -f "x86/$1" && test "$1" != "$output"; then
66 x86_args="$x86_args x86/$1"
68 x86_args="$x86_args $1"
72 $GCC_COMPILE_X86 $x86_args || exit $?
73 if test x"$output" != x; then
74 cp $output x86/$output
78 if test x"$output" != x; then
79 dir=x64/`dirname $output`
87 while test x$1 != x; do
88 if test -f "x64/$1" && test "$1" != "$output"; then
89 x64_args="$x64_args x64/$1"
91 x64_args="$x64_args $1"
95 $GCC_COMPILE_X64 $x64_args || exit $?
96 if test x"$output" != x; then
97 cp $output x64/$output
100 if test x"$output" != x; then
101 lipo -create -o $output x86/$output x64/$output