Add extern "C" to headers. Some files are missing this, which can cause issues with some compilers when using the C++ mode.

This commit is contained in:
David Garske
2019-06-18 15:19:22 -07:00
parent b957415609
commit a9fff57063
2 changed files with 16 additions and 6 deletions

View File

@ -33,6 +33,11 @@
#include <wolfssl/wolfcrypt/cryptocb.h>
#include <wolfssl/wolfcrypt/pkcs11.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Pkcs11Dev {
void* dlHandle; /* Handle to library */
CK_FUNCTION_LIST* func; /* Array of functions */
@ -53,10 +58,6 @@ typedef struct Pkcs11Session {
CK_SESSION_HANDLE handle; /* Handle to active session */
} Pkcs11Session;
#ifdef __cplusplus
extern "C" {
#endif
/* Types of keys that can be stored. */
enum Pkcs11KeyType {
PKCS11_KEY_TYPE_AES_GCM,

View File

@ -19,6 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef __cplusplus
extern "C" {
#endif
/* This section is included prior to wolfmath.h below */
#if defined(HAVE_WOLF_BIGINT) && !defined(WOLF_BIGINT_DEFINED)
/* raw big integer */
typedef struct WC_BIGINT {
@ -30,8 +35,8 @@
#define WOLF_BIGINT_DEFINED
#endif
/* only define functions if mp_int has been declared */
/* The MP_INT_DEFINED is defined in tfm.h and integer.h after mp_int */
#ifdef MP_INT_DEFINED
#ifndef __WOLFMATH_H__
@ -57,7 +62,7 @@
WC_TYPE_UNSIGNED_BIN = 2,
};
WOLFSSL_API int wc_export_int(mp_int* mp, byte* buf, word32* len,
WOLFSSL_API int wc_export_int(mp_int* mp, byte* buf, word32* len,
word32 keySz, int encType);
#ifdef HAVE_WOLF_BIGINT
@ -76,3 +81,7 @@
#endif /* __WOLFMATH_H__ */
#endif /* MP_INT_DEFINED */
#ifdef __cplusplus
} /* extern "C" */
#endif