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

Unified Diff: crypto/p224.cc

Issue 9614004: Avoid loading ws2_32.dll just to get htons() and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make patch 4.7% uglier with helpful TODOs. Created 8 years, 10 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
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224.cc
diff --git a/crypto/p224.cc b/crypto/p224.cc
index a7cc66b0be3c0195ee7f55a4def7843f25d7af43..d0e4baf3bba8f8c2b06cabce61cb9cc3867e14fc 100644
--- a/crypto/p224.cc
+++ b/crypto/p224.cc
@@ -13,6 +13,14 @@
#include "base/sys_byteorder.h"
+#if defined(OS_WIN)
+// Allow htonl/ntohl to be called without requiring ws2_32.dll to be loaded,
+// which isn't available in Chrome's sandbox. See crbug.com/116591.
+// TODO(wez): Replace these calls with base::htonl() etc when available.
+#define ntohl(x) _byteswap_ulong(x)
+#define htonl(x) _byteswap_ulong(x)
+#endif // OS_WIN
+
namespace {
// Field element functions.
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698