Skip to content

Commit

Permalink
Make randombytes.h compatible with C++ inclusion
Browse files Browse the repository at this point in the history
This is useful for people who want to use your function from C++.
  • Loading branch information
niekbouman authored May 13, 2019
1 parent 8e6228f commit 19fd002
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions randombytes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef sss_RANDOMBYTES_H
#define sss_RANDOMBYTES_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef _WIN32
/* Load size_t on windows */
#include <CRTDEFS.H>
Expand All @@ -14,5 +18,8 @@
*/
int randombytes(void *buf, size_t n);

#ifdef __cplusplus
}
#endif

#endif /* sss_RANDOMBYTES_H */

0 comments on commit 19fd002

Please sign in to comment.