Skip to content

Commit e1a14bb

Browse files
committed
fix implicit include
1 parent 9e051c8 commit e1a14bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/SPC/builder/unix/library/libwebp.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ trait libwebp
1010
{
1111
protected function build(): void
1212
{
13-
$code = 'int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
13+
$code = '#include <immintrin.h>
14+
int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
1415
$cc = getenv('CC') ?: 'gcc';
15-
[$ret] = shell()->execWithResult("echo '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
16+
[$ret] = shell()->execWithResult("printf '%s' '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
1617
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64' && PHP_OS_FAMILY === 'Linux';
1718

1819
UnixCMakeExecutor::create($this)

0 commit comments

Comments
 (0)