Moved __cplusplus extern statement to include struct definitions as well.
diff --git a/include/polarssl/x509write.h b/include/polarssl/x509write.h
index 35b318f..0d94f01 100644
--- a/include/polarssl/x509write.h
+++ b/include/polarssl/x509write.h
@@ -3,7 +3,7 @@
  *
  * \brief X509 buffer writing functionality
  *
- *  Copyright (C) 2006-2012, Brainspark B.V.
+ *  Copyright (C) 2006-2013, Brainspark B.V.
  *
  *  This file is part of PolarSSL (http://www.polarssl.org)
  *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@@ -33,6 +33,10 @@
 
 #include "rsa.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct _x509_req_name
 {
     char oid[128];
@@ -47,6 +51,10 @@
 int x509_write_cert_req( unsigned char *buf, size_t size, rsa_context *rsa,
                          x509_req_name *req_name, md_type_t md_alg );
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* POLARSSL_X509_WRITE_C */
 
 #endif /* POLARSSL_X509_WRITE_H */