Guard C++ headers.

Things like Swift, which attempt to precompile all our headers in C
mode, cannot cope without this.

Change-Id: If59229f5e7cb617da370b65bb39a4af1fbe3f70e
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66268
Reviewed-by: Bob Beck <bbe@google.com>
Auto-Submit: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
diff --git a/include/openssl/pki/certificate.h b/include/openssl/pki/certificate.h
index 3adaa03..782a70a 100644
--- a/include/openssl/pki/certificate.h
+++ b/include/openssl/pki/certificate.h
@@ -12,7 +12,7 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
-#ifndef OPENSSL_HEADER_BSSL_PKI_CERTIFICATE_H_
+#if !defined(OPENSSL_HEADER_BSSL_PKI_CERTIFICATE_H_) && defined(__cplusplus)
 #define OPENSSL_HEADER_BSSL_PKI_CERTIFICATE_H_
 
 #include <memory>
@@ -80,4 +80,4 @@
 
 }  // namespace bssl
 
-#endif  // OPENSSL_HEADER_BSSL_PKI_CERTIFICATE_H_
+#endif  // OPENSSL_HEADER_BSSL_PKI_CERTIFICATE_H_ && __cplusplus
diff --git a/include/openssl/pki/signature_verify_cache.h b/include/openssl/pki/signature_verify_cache.h
index 640132e..ae73765 100644
--- a/include/openssl/pki/signature_verify_cache.h
+++ b/include/openssl/pki/signature_verify_cache.h
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BSSL_PKI_SIGNATURE_VERIFY_CACHE_H_
+#if !defined(BSSL_PKI_SIGNATURE_VERIFY_CACHE_H_) && defined(__cplusplus)
 #define BSSL_PKI_SIGNATURE_VERIFY_CACHE_H_
 
 #include <openssl/base.h>
@@ -38,4 +38,4 @@
 
 }  // namespace bssl
 
-#endif  // BSSL_PKI_SIGNATURE_VERIFY_CACHE_H_
+#endif  // BSSL_PKI_SIGNATURE_VERIFY_CACHE_H_ && __cplusplus