git.iko.soy/typeable/entropy
on main help sign in
Include cpp options as cc options
80f7d6bThomas M. DuBuisson
cbits/rdrand.c+1−1
@@ -11,6 +11,7 @@ int cpu_has_rdrand()
11 return (cx & 0x40000000);
11 return (cx & 0x40000000);
12}
12}
13
13
14+#ifdef arch_x86_64
14// Returns 1 on success
15// Returns 1 on success
15inline int _rdrand64_step(uint64_t *therand)
16inline int _rdrand64_step(uint64_t *therand)
16{
17{
@@ -20,7 +21,6 @@ inline int _rdrand64_step(uint64_t *therand)
20 return (int) err;
21 return (int) err;
21}
22}
22
23
23−#ifdef arch_x86_64
24// Returns 0 on success, non-zero on failure.
24// Returns 0 on success, non-zero on failure.
25int get_rand_bytes(uint8_t *therand, size_t len)
25int get_rand_bytes(uint8_t *therand, size_t len)
26{
26{
entropy.cabal+3
@@ -45,13 +45,16 @@ library
45 cc-options: -DXEN -DHAVE_RDRAND
45 cc-options: -DXEN -DHAVE_RDRAND
46 if arch(x86_64)
46 if arch(x86_64)
47 cpp-options: -Darch_x86_64
47 cpp-options: -Darch_x86_64
48+ cc-options: -Darch_x86_64
48 -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
49 -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
49 c-sources: cbits/rdrand.c
50 c-sources: cbits/rdrand.c
50 include-dirs: cbits
51 include-dirs: cbits
51 if arch(i386)
52 if arch(i386)
52 cpp-options: -Darch_i386
53 cpp-options: -Darch_i386
54+ cc-options: -Darch_i386
53 if os(windows)
55 if os(windows)
54 cpp-options: -DisWindows
56 cpp-options: -DisWindows
57+ cc-options: -DisWindows
55 extra-libraries: advapi32
58 extra-libraries: advapi32
56 else
59 else
57 if !flag(halvm)
60 if !flag(halvm)