Differences From Artifact [3f9a87cf9e]:
- File
src/macros.h
— part of check-in
[a2a06d372a]
at
2018-07-28 16:48:55
on branch trunk
— macros.h: Add of_random()
This does *NOT* provide cryptographically secure randomness! (user: js, size: 20670) [annotate] [blame] [check-ins using]
To Artifact [cec5f5d20d]:
- File src/macros.h — part of check-in [d0b636d965] at 2018-07-28 17:46:26 on branch trunk — macros.h: Fix missing ) and #include (user: js, size: 20695) [annotate] [blame] [check-ins using]
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | + + | #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include "platform.h" #ifdef OF_OBJFW_RUNTIME # ifdef OF_COMPILING_OBJFW # import "ObjFW_RT.h" # else # import <ObjFW_RT/ObjFW_RT.h> |
︙ | |||
855 856 857 858 859 860 861 | 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | - + - + | #if defined(OF_HAVE_ARC4RANDOM) return arc4random(); #elif defined(OF_HAVE_RANDOM) struct timeval tv; gettimeofday(&tv, NULL); srandom((unsigned)(tv.tv_sec ^ tv.tv_usec)); |