old MSVC versions don't have rdtsc
[openssl.git] / crypto / rand / rand_win.c
index 56558c4f154a865b487610200c2ad120899b4947..7453fe589ea02b87718a06899925ba123e0ba314 100644 (file)
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
-#if defined(WINDOWS) || defined(WIN32)
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
 #include <windows.h>
 #ifndef _WIN32_WINNT
 # define _WIN32_WINNT 0x0400
@@ -582,7 +582,8 @@ static void readtimer(void)
        if (have_tsc) {
          __try {
            __asm {
-             rdtsc
+             _emit 0x0f
+             _emix 0x31
              mov cyclecount, eax
              }
            RAND_add(&cyclecount, sizeof(cyclecount), 1);