summaryrefslogtreecommitdiffstats
path: root/lib/libtls
diff options
context:
space:
mode:
authorbcook <bcook@openbsd.org>2015-06-19 06:20:11 +0000
committerbcook <bcook@openbsd.org>2015-06-19 06:20:11 +0000
commit0ed661cce7b4c238924a718dabe8d37b96fa2b95 (patch)
treeb24e52f3a50534e6ad2c25336366bc2e1fad78e4 /lib/libtls
parentDisable ENGINE_load_dynamic (dynamic engine support). (diff)
downloadwireguard-openbsd-0ed661cce7b4c238924a718dabe8d37b96fa2b95.tar.xz
wireguard-openbsd-0ed661cce7b4c238924a718dabe8d37b96fa2b95.zip
Add standard headers, C++ support to tls.h.
This makes using libtls easier to include by including dependent headers, making something like this work as expected: #include <iostream> #include <tls.h> int main() { std::cout << "tls_init: " << tls_init() << "\n"; } This also makes building a standalone libtls-portable simpler. ok doug@, jsing@
Diffstat (limited to 'lib/libtls')
-rw-r--r--lib/libtls/tls.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libtls/tls.h b/lib/libtls/tls.h
index e9971ade0e0..cb02ee8824b 100644
--- a/lib/libtls/tls.h
+++ b/lib/libtls/tls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.h,v 1.12 2015/03/31 14:03:38 jsing Exp $ */
+/* $OpenBSD: tls.h,v 1.13 2015/06/19 06:20:11 bcook Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -18,6 +18,13 @@
#ifndef HEADER_TLS_H
#define HEADER_TLS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
#define TLS_API 20141031
#define TLS_PROTOCOL_TLSv1_0 (1 << 1)
@@ -88,4 +95,8 @@ int tls_close(struct tls *_ctx);
uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HEADER_TLS_H */