Moved __cplusplus extern statement to include struct definitions as well.
diff --git a/include/polarssl/pem.h b/include/polarssl/pem.h
index 801c57b..969faa2 100644
--- a/include/polarssl/pem.h
+++ b/include/polarssl/pem.h
@@ -46,6 +46,10 @@
 #define POLARSSL_ERR_PEM_BAD_INPUT_DATA                    -0x1480  /**< Bad input parameters to function. */
 /* \} name */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * \brief       PEM context structure
  */
@@ -57,10 +61,6 @@
 }
 pem_context;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * \brief       PEM context setup
  *