Skip to content

Commit 19fd002

Browse files
authored
Make randombytes.h compatible with C++ inclusion
This is useful for people who want to use your function from C++.
1 parent 8e6228f commit 19fd002

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

randombytes.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#ifndef sss_RANDOMBYTES_H
22
#define sss_RANDOMBYTES_H
33

4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
48
#ifdef _WIN32
59
/* Load size_t on windows */
610
#include <CRTDEFS.H>
@@ -14,5 +18,8 @@
1418
*/
1519
int randombytes(void *buf, size_t n);
1620

21+
#ifdef __cplusplus
22+
}
23+
#endif
1724

1825
#endif /* sss_RANDOMBYTES_H */

0 commit comments

Comments
 (0)