Ensure consumers set up include paths properly.

In some cases, consumers may include a BoringSSL header without setting
up include paths. This risks pulling in system OpenSSL headers instead.
For almost every BoringSSL header, the first #include is base.h, which
does not exist upstream, thus the mistake will be caught.

The exception is base.h itself which naturally does not include itself.
Have it include an empty is_boringssl.h header to catch this mistake.

Change-Id: Ia96586ecc627ff46867d8af8b68138185866f074
Reviewed-on: https://boringssl-review.googlesource.com/14949
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/base.h b/include/openssl/base.h
index a9d1ec5..d121b6f 100644
--- a/include/openssl/base.h
+++ b/include/openssl/base.h
@@ -65,6 +65,10 @@
 #include <stdio.h>
 #endif
 
+/* Include a BoringSSL-only header so consumers including this header without
+ * setting up include paths do not accidentally pick up the system
+ * opensslconf.h. */
+#include <openssl/is_boringssl.h>
 #include <openssl/opensslconf.h>
 
 #if defined(BORINGSSL_PREFIX)
diff --git a/include/openssl/is_boringssl.h b/include/openssl/is_boringssl.h
new file mode 100644
index 0000000..def6e82
--- /dev/null
+++ b/include/openssl/is_boringssl.h
@@ -0,0 +1,16 @@
+/* Copyright (c) 2017, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to catch include path errors in consuming
+ * BoringSSL. */