summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/rand_win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rand/rand_win.c')
-rw-r--r--src/lib/libcrypto/rand/rand_win.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rand/rand_win.c b/src/lib/libcrypto/rand/rand_win.c
index 9f2dcff9a9..3d137badd0 100644
--- a/src/lib/libcrypto/rand/rand_win.c
+++ b/src/lib/libcrypto/rand/rand_win.c
@@ -570,14 +570,15 @@ static void readtimer(void)
570 DWORD w; 570 DWORD w;
571 LARGE_INTEGER l; 571 LARGE_INTEGER l;
572 static int have_perfc = 1; 572 static int have_perfc = 1;
573#ifndef __GNUC__ 573#ifdef _MSC_VER
574 static int have_tsc = 1; 574 static int have_tsc = 1;
575 DWORD cyclecount; 575 DWORD cyclecount;
576 576
577 if (have_tsc) { 577 if (have_tsc) {
578 __try { 578 __try {
579 __asm { 579 __asm {
580 rdtsc 580 _emit 0x0f
581 _emit 0x31
581 mov cyclecount, eax 582 mov cyclecount, eax
582 } 583 }
583 RAND_add(&cyclecount, sizeof(cyclecount), 1); 584 RAND_add(&cyclecount, sizeof(cyclecount), 1);
@@ -725,8 +726,9 @@ int RAND_poll(void)
725 726
726#ifdef DEVRANDOM 727#ifdef DEVRANDOM
727 return 1; 728 return 1;
728#endif 729#else
729 return 0; 730 return 0;
731#endif
730} 732}
731 733
732#endif 734#endif