Skip to content

Commit 1db9fd0

Browse files
committed
Patch for warnings being generated by clang-cl
1 parent f51f958 commit 1db9fd0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ option(CCMATH_FIND_GBENCH_PACKAGE "Enable finding of google benchmark package" O
3333
option(CCMATH_INSTALL "Setup install and package steps" ${is_root_project})
3434
option(CCMATH_ENABLE_EXTENSIONS "Enable the extended ccmath library that adds helpful additional methods that are not defined by the standard" ${is_root_project})
3535
option(CCMATH_ENABLE_RUNTIME_SIMD "Enable SIMD optimization for runtime evaluation (does not effect compile time)" ON)
36+
option(CCMATH_DISABLE_FORCE_INLINE "Disable the use of force inline in ccmath" OFF)
3637
option(CCMATH_ENABLE_USER_DEFINED_OPTIMIZATION_MACROS "Enable user defined optimization macros instead of having ccmath define its own internal ones in cmake" OFF)
3738
option(CCMATH_DISABLE_ERRNO "Disable the use of errno in ccmath during runtime" OFF)
3839

@@ -118,6 +119,10 @@ if (CCMATH_ENABLE_RUNTIME_SIMD)
118119
target_compile_definitions(${PROJECT_NAME} INTERFACE CCM_CONFIG_USE_RT_SIMD)
119120
endif ()
120121

122+
if (CCMATH_DISABLE_FORCE_INLINE)
123+
target_compile_definitions(${PROJECT_NAME} INTERFACE CCM_CONFIG_NO_FORCED_INLINE)
124+
endif ()
125+
121126
if (NOT CCMATH_ENABLE_USER_DEFINED_OPTIMIZATION_MACROS)
122127
# Set these definitions based on the build type to aid in identifying the optimization level.
123128
# These are essential when dealing with compiler specific outcomes that are based on the optimization level.

include/ccmath/internal/predef/attributes/always_inline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef CCM_ALWAYS_INLINE
1717
#if defined(CCM_CONFIG_NO_FORCED_INLINE)
1818
#define CCM_ALWAYS_INLINE inline
19-
#elif defined(__GNUC__) || defined(__clang__)
19+
#elif defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER)
2020
#define CCM_ALWAYS_INLINE __attribute__((always_inline)) inline
2121
#elif defined(_MSC_VER)
2222
#define CCM_ALWAYS_INLINE __forceinline

0 commit comments

Comments
 (0)