From 30b95fa9218b5a554163d7bd503740994446c51c Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Tue, 1 Oct 2013 10:09:06 +0200
Subject: [PATCH] Fixed cplusplus extern defines in header files
---
include/polarssl/ecp.h | 4 ----
include/polarssl/openssl.h | 6 +++++-
include/polarssl/x509.h | 5 +++++
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h
index dec4e0a681..3a9a7b667c 100644
--- a/include/polarssl/ecp.h
+++ b/include/polarssl/ecp.h
@@ -176,10 +176,6 @@ ecp_keypair;
*/
#define POLARSSL_ECP_TLS_NAMED_CURVE 3 /**< ECCurveType's named_curve */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* \brief Return the list of supported curves with associated info
*
diff --git a/include/polarssl/openssl.h b/include/polarssl/openssl.h
index 62609a2973..0e9de221ce 100644
--- a/include/polarssl/openssl.h
+++ b/include/polarssl/openssl.h
@@ -62,6 +62,10 @@
#define AES_cbc_encrypt( INPUT, OUTPUT, LEN, CTX, IV, MODE ) \
aes_crypt_cbc( (CTX), (MODE), (LEN), (IV), (INPUT), (OUTPUT) )
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* RSA stuff follows. TODO: needs cleanup
*/
@@ -76,7 +80,7 @@ inline rsa_context* d2i_RSA_PUBKEY( void *ignore, unsigned char **bufptr,
{
unsigned char *buffer = *(unsigned char **) bufptr;
rsa_context *rsa;
-
+
/*
* Not a general-purpose parser: only parses public key from *exactly*
* openssl genrsa -out privkey.pem 512 (or 1024)
diff --git a/include/polarssl/x509.h b/include/polarssl/x509.h
index 285e69caf1..e7472c43f6 100644
--- a/include/polarssl/x509.h
+++ b/include/polarssl/x509.h
@@ -274,4 +274,9 @@ int x509_write_names( unsigned char **p, unsigned char *start,
int x509_write_sig( unsigned char **p, unsigned char *start,
const char *oid, size_t oid_len,
unsigned char *sig, size_t size );
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* x509.h */