diff options
author | David Schleef <ds@ginger.bigkitten.com> | 2008-05-29 13:59:09 -0700 |
---|---|---|
committer | David Schleef <ds@ginger.bigkitten.com> | 2008-05-29 13:59:09 -0700 |
commit | 8304de0c341d3e79799c0e6c00dafe62bbf079e0 (patch) | |
tree | dea099a98265ad6435894d41da21f2860b73977d /liboil/liboilcpu-x86.c | |
parent | 74128fd0b3f857ed06411a1f6fd0a17907382db7 (diff) | |
download | liboil-8304de0c341d3e79799c0e6c00dafe62bbf079e0.tar.gz |
[oil] Compile fixes for windows
Diffstat (limited to 'liboil/liboilcpu-x86.c')
-rw-r--r-- | liboil/liboilcpu-x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c index ebddc93..56f7790 100644 --- a/liboil/liboilcpu-x86.c +++ b/liboil/liboilcpu-x86.c @@ -34,14 +34,18 @@ #include <liboil/liboilfault.h> #include <liboil/liboilutils.h> +#ifdef HAVE_UNISTD_H #include <unistd.h> +#endif #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <setjmp.h> #include <signal.h> +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> +#endif #include <time.h> #if defined(__FreeBSD__) || defined(__APPLE__) @@ -129,6 +133,7 @@ oil_cpu_i386_getflags_cpuinfo (char *cpuinfo) } #endif +#ifdef HAVE_GCC_ASM static unsigned long oil_profile_stamp_rdtsc(void) { @@ -136,6 +141,7 @@ oil_profile_stamp_rdtsc(void) __asm__ __volatile__("rdtsc\n" : "=a" (ts) : : "edx"); return ts; } +#endif #ifdef USE_I386_CPUID #ifdef __i386__ @@ -201,9 +207,11 @@ oil_cpu_detect_cpuid (void) get_cpuid (0x00000001, &eax, &ebx, &ecx, &edx); +#ifdef HAVE_GCC_ASM if (edx & (1<<4)) { _oil_profile_stamp = oil_profile_stamp_rdtsc; } +#endif /* Intel flags */ if (edx & (1<<15)) { |