shithub: mp3dec

Download patch

ref: c23eb221ef37728e99b6f4640c94095c3bc99b6e
parent: c53f8e879601d369f3bec75a71a8b0df00f7122c
parent: e12b9428cfd96668aaa30cc35023b7cae17c95a4
author: Lion <lieff@users.noreply.github.com>
date: Fri Jan 12 09:37:19 EST 2018

Merge pull request #4 from manxorist/no-underscore-cpuid
Rename __cpuid to minimp3_cpuid because double underscore names are reserved in C.

--- a/minimp3.h
+++ b/minimp3.h
@@ -97,8 +97,10 @@
 #   define VMUL_S(x, s)  _mm_mul_ps(x, _mm_set1_ps(s))
 #   define VREV(x) _mm_shuffle_ps(x, x, _MM_SHUFFLE(0, 1, 2, 3))
 typedef __m128 f4;
-#ifndef _MSC_VER
-static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType)
+#ifdef _MSC_VER
+#define minimp3_cpuid __cpuid
+#else
+static __inline__ __attribute__((always_inline)) void minimp3_cpuid(int CPUInfo[], const int InfoType)
 {
 #if defined(__PIC__)
     __asm__ __volatile__(
@@ -125,10 +127,10 @@
 static int have_simd()
 {
     int CPUInfo[4];
-    __cpuid(CPUInfo, 0);
+    minimp3_cpuid(CPUInfo, 0);
     if (CPUInfo[0] > 0)
     {
-        __cpuid(CPUInfo, 1);
+        minimp3_cpuid(CPUInfo, 1);
         return (CPUInfo[3] & (1 << 26)); // SSE2
     }
     return 0;