Skip to content

Commit

Permalink
Support clang-cl
Browse files Browse the repository at this point in the history
They fixed the intrinsics headers

Change-Id: I6ddc749194107cf6dcc5a38c18d5f8524d9bb2d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
Allan Sandfeld Jensen committed Nov 15, 2024
1 parent a5297fa commit 1ac0cfa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/corelib/global/qlogging_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <QtCore/private/qglobal_p.h>
#include "qlogging.h"
#include "qloggingcategory.h"
#include <QtCore/qloggingcategory.h>

#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(regularexpression)
# if __has_include(<cxxabi.h>) && QT_CONFIG(backtrace)
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/global/qsimd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static inline quint64 detectProcessorFeatures()
# define X86_BASELINE "no-sse"
#endif

#if defined(Q_CC_GNU)
#if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
// lower the target for functions in this file
# undef QT_FUNCTION_TARGET_BASELINE
# define QT_FUNCTION_TARGET_BASELINE __attribute__((target(X86_BASELINE)))
Expand Down
6 changes: 3 additions & 3 deletions src/corelib/global/qsimd_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ QT_WARNING_DISABLE_INTEL(103)

#if defined(Q_PROCESSOR_ARM_64)
# define QT_COMPILER_SUPPORTS_HERE(x) ((__ARM_FEATURE_ ## x) || (__ ## x ## __) || QT_COMPILER_SUPPORTS(x))
# if defined(Q_CC_GNU)
# if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
/* GCC requires attributes for a function */
# define QT_FUNCTION_TARGET(x) __attribute__((__target__(QT_FUNCTION_TARGET_STRING_ ## x)))
# else
Expand All @@ -124,12 +124,12 @@ QT_WARNING_DISABLE_INTEL(103)
# define QT_COMPILER_SUPPORTS_HERE(x) QT_COMPILER_SUPPORTS(x)
# define QT_FUNCTION_TARGET(x)
#elif defined(Q_PROCESSOR_X86)
# if defined(Q_CC_CLANG) && defined(Q_CC_MSVC)
# if defined(Q_CC_CLANG) && defined(Q_CC_MSVC) && (Q_CC_CLANG < 1900)
# define QT_COMPILER_SUPPORTS_HERE(x) (__ ## x ## __)
# else
# define QT_COMPILER_SUPPORTS_HERE(x) ((__ ## x ## __) || QT_COMPILER_SUPPORTS(x))
# endif
# if defined(Q_CC_GNU)
# if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
/* GCC requires attributes for a function */
# define QT_FUNCTION_TARGET(x) __attribute__((__target__(QT_FUNCTION_TARGET_STRING_ ## x)))
# else
Expand Down
3 changes: 2 additions & 1 deletion src/corelib/global/qsystemdetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@
#if defined(__SIZEOF_INT128__)
// Compiler used in VxWorks SDK declares __SIZEOF_INT128__ but VxWorks doesn't support this type,
// so we can't rely solely on compiler here.
#if !defined(Q_OS_VXWORKS)
// MSVC STL used by MSVC and clang-cl does not support int128
#if !defined(Q_OS_VXWORKS) && !defined(_MSC_VER)
# define QT_COMPILER_SUPPORTS_INT128 __SIZEOF_INT128__
#endif
#endif // defined(__SIZEOF_INT128__)
Expand Down

0 comments on commit 1ac0cfa

Please sign in to comment.