]> git.sesse.net Git - vlc/blobdiff - src/misc/cpu.c
Updated copyrights in libvlc
[vlc] / src / misc / cpu.c
index 8247674001dfc051a716f3da0e28be5bf698fbcf..10e19cb4035b3f2564c9d0c9a9c01988ce437019 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * cpu.c: CPU detection code
  *****************************************************************************
- * Copyright (C) 1998-2002 VideoLAN
- * $Id: cpu.c,v 1.8 2002/11/10 18:04:24 sam Exp $
+ * Copyright (C) 1998-2004 VideoLAN
+ * $Id: cpu.c,v 1.12 2004/01/06 12:02:06 zorglub Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -65,9 +65,9 @@ static char   *psz_capability;
  *****************************************************************************
  * This function is called to list extensions the CPU may have.
  *****************************************************************************/
-u32 CPUCapabilities( void )
+uint32_t CPUCapabilities( void )
 {
-    volatile u32 i_capabilities = CPU_CAPABILITY_NONE;
+    volatile uint32_t i_capabilities = CPU_CAPABILITY_NONE;
 
 #if defined( SYS_DARWIN )
     struct host_basic_info hi;
@@ -106,7 +106,7 @@ u32 CPUCapabilities( void )
     volatile vlc_bool_t    b_amd;
 
     /* Needed for x86 CPU capabilities detection */
-#   define cpuid( a )                      \
+#   define cpuid( reg )                    \
         asm volatile ( "pushl %%ebx\n\t"   \
                        "cpuid\n\t"         \
                        "movl %%ebx,%1\n\t" \
@@ -115,7 +115,7 @@ u32 CPUCapabilities( void )
                        "=r" ( i_ebx ),     \
                        "=c" ( i_ecx ),     \
                        "=d" ( i_edx )      \
-                     : "a"  ( a )          \
+                     : "a"  ( reg )        \
                      : "cc" );
 
 #   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW ) \
@@ -285,6 +285,10 @@ u32 CPUCapabilities( void )
     i_capabilities |= CPU_CAPABILITY_FPU;
     return i_capabilities;
 
+#elif defined( _MSC_VER )
+    i_capabilities |= CPU_CAPABILITY_FPU;
+    return i_capabilities;
+
 #else
     /* default behaviour */
     return i_capabilities;