Skip to content

Commit 5aac86e

Browse files
committed
vendor: libsamplerate: only build SSE code on x86 platform
On non-x86 platforms, macro HAVE_IMMINTRIN_H (populated by CMake) will be zero. But the original code use #ifdef for checking, which means a zero value will trigger SSE optimizations. This is unexpected. So I changed #ifdef to #if.
1 parent 7abec44 commit 5aac86e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vendor/libsamplerate/src/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ SRC_STATE *zoh_state_new (int channels, SRC_ERROR *error) ;
172172

173173
static inline int psf_lrintf (float x)
174174
{
175-
#ifdef HAVE_IMMINTRIN_H
175+
#if HAVE_IMMINTRIN_H
176176
return _mm_cvtss_si32 (_mm_load_ss (&x)) ;
177177
#else
178178
return lrintf (x) ;
@@ -181,7 +181,7 @@ static inline int psf_lrintf (float x)
181181

182182
static inline int psf_lrint (double x)
183183
{
184-
#ifdef HAVE_IMMINTRIN_H
184+
#if HAVE_IMMINTRIN_H
185185
return _mm_cvtsd_si32 (_mm_load_sd (&x)) ;
186186
#else
187187
return lrint (x) ;

0 commit comments

Comments
 (0)