From: bcook Date: Fri, 19 Jun 2015 06:20:11 +0000 (+0000) Subject: Add standard headers, C++ support to tls.h. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0ed661cce7b4c238924a718dabe8d37b96fa2b95;p=openbsd 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 #include int main() { std::cout << "tls_init: " << tls_init() << "\n"; } This also makes building a standalone libtls-portable simpler. ok doug@, jsing@ --- 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 * @@ -18,6 +18,13 @@ #ifndef HEADER_TLS_H #define HEADER_TLS_H +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + #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 */