Skip to content

Commit 934faaa

Browse files
hjmjohnsonclaude
andcommitted
STYLE: Simplify AVX detection guards to #ifndef form
Replace the redundant `!defined(__AVX__) || !__AVX__` pattern with the conventional `#ifndef __AVX__` form. All major compilers (GCC, Clang, MSVC /arch:AVX) define __AVX__ as 1 (never 0) when AVX is active, so the `|| !__AVX__` branch is dead code. Addresses Greptile P2 review comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3662401 commit 934faaa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CMake/itkExternal_FFTW.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ if(NOT ITK_USE_SYSTEM_FFTW)
170170
# pass -DFFTW_ENABLE_AVX2=ON explicitly.
171171
unset(_fftw_compiler_targets_avx CACHE)
172172
check_c_source_compiles(
173-
"#if !defined(__AVX__) || !__AVX__\n#error AVX not enabled\n#endif\nint main(void){return 0;}"
173+
"#ifndef __AVX__\n#error AVX not enabled\n#endif\nint main(void){return 0;}"
174174
_fftw_compiler_targets_avx
175175
)
176176
if(_fftw_compiler_targets_avx)
177177
set(_fftw_default_avx ON)
178178
endif()
179179
unset(_fftw_compiler_targets_avx2 CACHE)
180180
check_c_source_compiles(
181-
"#if !defined(__AVX2__) || !__AVX2__\n#error AVX2 not enabled\n#endif\nint main(void){return 0;}"
181+
"#ifndef __AVX2__\n#error AVX2 not enabled\n#endif\nint main(void){return 0;}"
182182
_fftw_compiler_targets_avx2
183183
)
184184
if(_fftw_compiler_targets_avx2)

0 commit comments

Comments
 (0)