Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: crypto/wincrypt.h

Issue 686883002: Add crypto/wincrypt_shim.h wrapper header to resolve BoringSSL conflicts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: X509_NAME -> WINCRYPT_X509_NAME, rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: crypto/wincrypt.h
diff --git a/crypto/wincrypt.h b/crypto/wincrypt.h
new file mode 100644
index 0000000000000000000000000000000000000000..146a51feb3a337f85a04689c4ab0373ac9eb3993
--- /dev/null
+++ b/crypto/wincrypt.h
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_CRYPTO_WINCRYPT_H_
+#define NET_CRYPTO_WINCRYPT_H_
+
+// wincrypt.h defines macros which conflict with OpenSSL's types. This header
+// includes wincrypt and undefines the OpenSSL macros which conflict. Any
+// Chromium headers which include wincrypt should instead include this header.
+
+#include <windows.h>
+#include <wincrypt.h>
+
+// Undefine the macros which conflict with OpenSSL and define replacements. See
+// http://msdn.microsoft.com/en-us/library/windows/desktop/aa378145(v=vs.85).aspx
+#undef X509_CERT_PAIR
+#undef X509_EXTENSIONS
+#undef X509_NAME
+
+#define WINCRYPT_X509_CERT_PAIR ((LPCSTR) 53)
+#define WINCRYPT_X509_EXTENSIONS ((LPCSTR) 5)
+#define WINCRYPT_X509_NAME ((LPCSTR) 7)
+
+#endif // NET_CRYPTO_WINCRYPT_H_

Powered by Google App Engine
This is Rietveld 408576698