Add static_asserts for FX_RECT and FX_COLORREF.

Make sure they match their win32 equivalent data types.

Change-Id: I395054ce5c5ae110c78dbae30dd985fc498045fb
Reviewed-on: https://pdfium-review.googlesource.com/30070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/fx_coordinates.cpp b/core/fxcrt/fx_coordinates.cpp
index ad64f0b..13c6f1b 100644
--- a/core/fxcrt/fx_coordinates.cpp
+++ b/core/fxcrt/fx_coordinates.cpp
@@ -6,7 +6,6 @@
 
 #include "core/fxcrt/fx_coordinates.h"
 
-#include <algorithm>
 #include <utility>
 
 #include "core/fxcrt/fx_extension.h"
@@ -24,6 +23,26 @@
   *i2 = *i1 + length;
 }
 
+#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
+static_assert(sizeof(FX_RECT) == sizeof(RECT), "FX_RECT vs. RECT mismatch");
+static_assert(offsetof(FX_RECT, left) == offsetof(RECT, left),
+              "FX_RECT vs. RECT mismatch");
+static_assert(offsetof(FX_RECT, top) == offsetof(RECT, top),
+              "FX_RECT vs. RECT mismatch");
+static_assert(offsetof(FX_RECT, right) == offsetof(RECT, right),
+              "FX_RECT vs. RECT mismatch");
+static_assert(offsetof(FX_RECT, bottom) == offsetof(RECT, bottom),
+              "FX_RECT vs. RECT mismatch");
+static_assert(sizeof(FX_RECT::left) == sizeof(RECT::left),
+              "FX_RECT vs. RECT mismatch");
+static_assert(sizeof(FX_RECT::top) == sizeof(RECT::top),
+              "FX_RECT vs. RECT mismatch");
+static_assert(sizeof(FX_RECT::right) == sizeof(RECT::right),
+              "FX_RECT vs. RECT mismatch");
+static_assert(sizeof(FX_RECT::bottom) == sizeof(RECT::bottom),
+              "FX_RECT vs. RECT mismatch");
+#endif
+
 }  // namespace
 
 void FX_RECT::Normalize() {
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index 546198b..e2e2213 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -12,6 +12,11 @@
 #include "core/fxcrt/fx_extension.h"
 #include "third_party/base/ptr_util.h"
 
+#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
+static_assert(sizeof(FX_COLORREF) == sizeof(COLORREF),
+              "FX_COLORREF vs. COLORREF mismatch");
+#endif
+
 const int16_t SDP_Table[513] = {
     256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255,
     254, 254, 254, 254, 253, 253, 253, 252, 252, 252, 251, 251, 251, 250, 250,