Moved __cplusplus extern statement to include struct definitions as well.
diff --git a/include/polarssl/sha2.h b/include/polarssl/sha2.h
index 795299e..9df46fb 100644
--- a/include/polarssl/sha2.h
+++ b/include/polarssl/sha2.h
@@ -44,6 +44,10 @@
 // Regular implementation
 //
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * \brief          SHA-256 context structure
  */
@@ -59,10 +63,6 @@
 }
 sha2_context;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * \brief          SHA-256 context setup
  *