Skip to content

Commit c9ea28c

Browse files
committed
[embedded] Make linux-rng-support.c friendly to compiling in both C and C++ mode
1 parent 461a25c commit c9ea28c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/embedded/Inputs/linux-rng-support.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55

66
#ifdef __linux__
77

8+
#ifdef __cplusplus
9+
extern "C"
10+
#endif
811
ssize_t getrandom(void *buf, size_t len, unsigned int flags);
912

13+
#ifdef __cplusplus
14+
extern "C"
15+
#endif
16+
void arc4random_buf(void *buf, size_t nbytes);
17+
1018
void arc4random_buf(void *buf, size_t nbytes) {
1119
while (nbytes > 0) {
1220
ssize_t actual_nbytes = 0;

0 commit comments

Comments
 (0)