Enable Eigen to compile on 'pure C/C++' Gcc environment (with no inline assembly or asm directive). Required if we want to use Eigen with Adobe Alchemy.

This commit is contained in:
Zuiquan 2012-02-02 12:05:02 +01:00
parent 13abb37721
commit a64407f086
2 changed files with 16 additions and 14 deletions

View File

@ -255,7 +255,7 @@
// Suppresses 'unused variable' warnings.
#define EIGEN_UNUSED_VARIABLE(var) (void)var;
#if (defined __GNUC__)
#if !defined(EIGEN_ASM_COMMENT) && (defined __GNUC__)
#define EIGEN_ASM_COMMENT(X) asm("#" X)
#else
#define EIGEN_ASM_COMMENT(X)

View File

@ -741,7 +741,8 @@ public:
//---------- Cache sizes ----------
#if defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
#if !defined(EIGEN_NO_CPUID)
# if defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
# if defined(__PIC__) && defined(__i386__)
// Case for x86 with PIC
# define EIGEN_CPUID(abcd,func,id) \
@ -751,10 +752,11 @@ public:
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id) );
# endif
#elif defined(_MSC_VER)
# elif defined(_MSC_VER)
# if (_MSC_VER > 1500)
# define EIGEN_CPUID(abcd,func,id) __cpuidex((int*)abcd,func,id)
# endif
# endif
#endif
namespace internal {