Pārlūkot izejas kodu

remove [X]CLOCKS_PER_SEC

Steffen Jaeckel 8 gadi atpakaļ
vecāks
revīzija
ecb2402ba8
2 mainītis faili ar 1 papildinājumiem un 9 dzēšanām
  1. 0 3
      src/headers/tomcrypt_custom.h
  2. 1 6
      src/prngs/rng_get_bytes.c

+ 0 - 3
src/headers/tomcrypt_custom.h

@@ -34,9 +34,6 @@
 #ifndef XCLOCK
 #define XCLOCK   clock
 #endif
-#ifndef XCLOCKS_PER_SEC
-#define XCLOCKS_PER_SEC CLOCKS_PER_SEC
-#endif
 
 #ifndef XQSORT
 #define XQSORT qsort

+ 1 - 6
src/prngs/rng_get_bytes.c

@@ -54,8 +54,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len,
 
 #endif /* LTC_DEVRANDOM */
 
-/* on ANSI C platforms with 100 < CLOCKS_PER_SEC < 10000 */
-#if defined(CLOCKS_PER_SEC) && !defined(_WIN32_WCE)
+#if !defined(_WIN32_WCE)
 
 #define ANSI_RNG
 
@@ -65,10 +64,6 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
    clock_t t1;
    int l, acc, bits, a, b;
 
-   if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 10000) {
-      return 0;
-   }
-
    l = len;
    bits = 8;
    acc  = a = b = 0;