*****************************************************************************/
static jmp_buf env;
static int i_illegal;
+
#if defined( __i386__ ) || defined( __x86_64__ )
-static const char *psz_capability;
+static void warn_cap( const char *psz_capability )
+{
+ fprintf( stderr, "warning: your CPU has %s instructions, but not your "
+ "operating system.\n", psz_capability );
+ fprintf( stderr, " some optimizations will be disabled unless "
+ "you upgrade your OS\n" );
+}
#endif
/*****************************************************************************
# ifdef CAN_COMPILE_SSE
/* We test if OS supports the SSE instructions */
- psz_capability = "SSE";
i_illegal = 0;
if( setjmp( env ) == 0 )
}
if( i_illegal == 0 )
- {
i_capabilities |= CPU_CAPABILITY_SSE;
- }
+ else
+ warn_cap( "SSE" );
# endif
}
{
# if defined(CAN_COMPILE_SSE)
/* We test if OS supports the SSE instructions */
- psz_capability = "SSE2";
i_illegal = 0;
if( setjmp( env ) == 0 )
}
if( i_illegal == 0 )
- {
i_capabilities |= CPU_CAPABILITY_SSE2;
- }
+ else
+ warn_cap( "SSE2" );
# endif
}
# ifdef CAN_COMPILE_3DNOW
if( i_edx & 0x80000000 )
{
- psz_capability = "3D Now!";
i_illegal = 0;
if( setjmp( env ) == 0 )
}
if( i_illegal == 0 )
- {
i_capabilities |= CPU_CAPABILITY_3DNOW;
- }
+ else
+ warn_cap( "3D Now!" );
}
# endif
#else
VLC_UNUSED( i_signal );
#endif
-
-#if defined( __i386__ )
- fprintf( stderr, "warning: your CPU has %s instructions, but not your "
- "operating system.\n", psz_capability );
- fprintf( stderr, " some optimizations will be disabled unless "
- "you upgrade your OS\n" );
-# if defined( __linux__ )
- fprintf( stderr, " (for instance Linux kernel 2.4.x or later)\n" );
-# endif
-#endif
-
longjmp( env, 1 );
}