Skip to content

Commit e86e14a

Browse files
chenguokaipaolostivanin
authored andcommitted
Add support for C++ call (#25)
A minor change that enables calls from C++.
1 parent 6b2ac0b commit e86e14a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/cotp.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ typedef enum _cotp_errno {
1515
INVALID_PERIOD = 6
1616
} cotp_error_t;
1717

18-
18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
1921
char *get_hotp (const char *base32_encoded_secret,
2022
long counter,
2123
int digits,
@@ -56,3 +58,8 @@ int hotp_verify (const char *base32_encoded_secret,
5658
int digits,
5759
const char *user_hotp,
5860
int sha_algo);
61+
62+
63+
#ifdef __cplusplus
64+
}
65+
#endif

0 commit comments

Comments
 (0)