Remove fx_system.h include from some headers.

Directly include system headers like <stdint.h> instead.

Change-Id: Ie97e9025570575f634273dd6b073ba90dc554ad2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/82712
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cpvt_wordinfo.h b/core/fpdfdoc/cpvt_wordinfo.h
index e23ab2c..e272dc9 100644
--- a/core/fpdfdoc/cpvt_wordinfo.h
+++ b/core/fpdfdoc/cpvt_wordinfo.h
@@ -7,7 +7,7 @@
 #ifndef CORE_FPDFDOC_CPVT_WORDINFO_H_
 #define CORE_FPDFDOC_CPVT_WORDINFO_H_
 
-#include "core/fxcrt/fx_system.h"
+#include <stdint.h>
 
 struct CPVT_WordInfo {
   CPVT_WordInfo();
diff --git a/core/fxcodec/cfx_codec_memory.cpp b/core/fxcodec/cfx_codec_memory.cpp
index 256e15c..a038079 100644
--- a/core/fxcodec/cfx_codec_memory.cpp
+++ b/core/fxcodec/cfx_codec_memory.cpp
@@ -4,6 +4,8 @@
 
 #include "core/fxcodec/cfx_codec_memory.h"
 
+#include <string.h>
+
 #include <algorithm>
 
 CFX_CodecMemory::CFX_CodecMemory(size_t buffer_size)
diff --git a/core/fxcodec/scanlinedecoder.h b/core/fxcodec/scanlinedecoder.h
index e0014cf..0fad633 100644
--- a/core/fxcodec/scanlinedecoder.h
+++ b/core/fxcodec/scanlinedecoder.h
@@ -7,7 +7,7 @@
 #ifndef CORE_FXCODEC_SCANLINEDECODER_H_
 #define CORE_FXCODEC_SCANLINEDECODER_H_
 
-#include "core/fxcrt/fx_system.h"
+#include <stdint.h>
 
 class PauseIndicatorIface;
 
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index 4a3fa7f..b54f896 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -18,6 +18,7 @@
 #include "core/fxcrt/fx_codepage.h"
 #include "core/fxcrt/fx_extension.h"
 #include "core/fxcrt/fx_safe_types.h"
+#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/string_pool_template.h"
 #include "third_party/base/check.h"
 #include "third_party/base/check_op.h"
diff --git a/core/fxcrt/bytestring.h b/core/fxcrt/bytestring.h
index c6ba395..12195b5 100644
--- a/core/fxcrt/bytestring.h
+++ b/core/fxcrt/bytestring.h
@@ -9,17 +9,19 @@
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdint.h>
+#include <string.h>
 
 #include <functional>
 #include <iosfwd>
 #include <iterator>
 #include <utility>
 
-#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/string_data_template.h"
 #include "core/fxcrt/string_view_template.h"
 #include "third_party/base/check.h"
+#include "third_party/base/compiler_specific.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/span.h"
 
diff --git a/core/fxcrt/fx_coordinates.cpp b/core/fxcrt/fx_coordinates.cpp
index ca691a8..511e069 100644
--- a/core/fxcrt/fx_coordinates.cpp
+++ b/core/fxcrt/fx_coordinates.cpp
@@ -11,6 +11,7 @@
 #include "build/build_config.h"
 #include "core/fxcrt/fx_extension.h"
 #include "core/fxcrt/fx_safe_types.h"
+#include "core/fxcrt/fx_system.h"
 #include "third_party/base/cxx17_backports.h"
 
 #ifndef NDEBUG
diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h
index 4a7d33c..3f43d6c 100644
--- a/core/fxcrt/fx_coordinates.h
+++ b/core/fxcrt/fx_coordinates.h
@@ -7,9 +7,10 @@
 #ifndef CORE_FXCRT_FX_COORDINATES_H_
 #define CORE_FXCRT_FX_COORDINATES_H_
 
-#include <algorithm>
+#include <math.h>
+#include <stdint.h>
 
-#include "core/fxcrt/fx_system.h"
+#include <algorithm>
 
 #ifndef NDEBUG
 #include <iosfwd>
diff --git a/core/fxcrt/fx_coordinates_unittest.cpp b/core/fxcrt/fx_coordinates_unittest.cpp
index 7539ab7..d1673f5 100644
--- a/core/fxcrt/fx_coordinates_unittest.cpp
+++ b/core/fxcrt/fx_coordinates_unittest.cpp
@@ -7,6 +7,7 @@
 #include <limits>
 #include <vector>
 
+#include "core/fxcrt/fx_system.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
diff --git a/core/fxcrt/maybe_owned.h b/core/fxcrt/maybe_owned.h
index 3ddb2e3..64644b0 100644
--- a/core/fxcrt/maybe_owned.h
+++ b/core/fxcrt/maybe_owned.h
@@ -8,7 +8,6 @@
 #include <memory>
 #include <utility>
 
-#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "third_party/base/check.h"
 
diff --git a/core/fxcrt/observed_ptr.h b/core/fxcrt/observed_ptr.h
index a1a1c22..e45cad6 100644
--- a/core/fxcrt/observed_ptr.h
+++ b/core/fxcrt/observed_ptr.h
@@ -5,9 +5,10 @@
 #ifndef CORE_FXCRT_OBSERVED_PTR_H_
 #define CORE_FXCRT_OBSERVED_PTR_H_
 
+#include <stddef.h>
+
 #include <set>
 
-#include "core/fxcrt/fx_system.h"
 #include "third_party/base/check.h"
 
 namespace fxcrt {
diff --git a/core/fxcrt/retain_ptr.h b/core/fxcrt/retain_ptr.h
index 8d18647..87e22f7 100644
--- a/core/fxcrt/retain_ptr.h
+++ b/core/fxcrt/retain_ptr.h
@@ -5,11 +5,12 @@
 #ifndef CORE_FXCRT_RETAIN_PTR_H_
 #define CORE_FXCRT_RETAIN_PTR_H_
 
+#include <stdint.h>
+
 #include <functional>
 #include <memory>
 #include <utility>
 
-#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "third_party/base/check.h"
 
diff --git a/core/fxcrt/string_data_template.h b/core/fxcrt/string_data_template.h
index 8370186..f311e6c 100644
--- a/core/fxcrt/string_data_template.h
+++ b/core/fxcrt/string_data_template.h
@@ -7,7 +7,8 @@
 #ifndef CORE_FXCRT_STRING_DATA_TEMPLATE_H_
 #define CORE_FXCRT_STRING_DATA_TEMPLATE_H_
 
-#include "core/fxcrt/fx_system.h"
+#include <stddef.h>
+#include <stdint.h>
 
 namespace fxcrt {
 
diff --git a/core/fxcrt/tree_node.h b/core/fxcrt/tree_node.h
index 97adfe5..2d96971 100644
--- a/core/fxcrt/tree_node.h
+++ b/core/fxcrt/tree_node.h
@@ -5,7 +5,8 @@
 #ifndef CORE_FXCRT_TREE_NODE_H_
 #define CORE_FXCRT_TREE_NODE_H_
 
-#include "core/fxcrt/fx_system.h"
+#include <stdint.h>
+
 #include "third_party/base/check.h"
 
 namespace fxcrt {
diff --git a/core/fxcrt/weak_ptr.h b/core/fxcrt/weak_ptr.h
index 7b345aa..9e25ab4 100644
--- a/core/fxcrt/weak_ptr.h
+++ b/core/fxcrt/weak_ptr.h
@@ -7,6 +7,8 @@
 #ifndef CORE_FXCRT_WEAK_PTR_H_
 #define CORE_FXCRT_WEAK_PTR_H_
 
+#include <stdint.h>
+
 #include <cstddef>
 #include <memory>
 #include <utility>
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index a69658a..277cbbc 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -7,6 +7,7 @@
 #include "core/fxcrt/widestring.h"
 
 #include <stddef.h>
+#include <string.h>
 
 #include <algorithm>
 #include <cctype>
@@ -15,6 +16,7 @@
 #include "core/fxcrt/fx_codepage.h"
 #include "core/fxcrt/fx_extension.h"
 #include "core/fxcrt/fx_safe_types.h"
+#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/string_pool_template.h"
 #include "third_party/base/check.h"
 #include "third_party/base/check_op.h"
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index affd267..a8706e6 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -9,17 +9,19 @@
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdint.h>
+#include <wchar.h>
 
 #include <functional>
 #include <iosfwd>
 #include <iterator>
 #include <utility>
 
-#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/string_data_template.h"
 #include "core/fxcrt/string_view_template.h"
 #include "third_party/base/check.h"
+#include "third_party/base/compiler_specific.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/span.h"
 
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 35abf58..ff6baad 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -10,6 +10,7 @@
 #include <memory>
 #include <utility>
 
+#include "core/fxcrt/fx_system.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/dib/cfx_imagestretcher.h"
 #include "core/fxge/dib/fx_dib.h"
diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h
index da5792e..0ce11d5 100644
--- a/core/fxge/dib/cstretchengine.h
+++ b/core/fxge/dib/cstretchengine.h
@@ -11,6 +11,7 @@
 
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/fx_memory_wrappers.h"
+#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/dib/fx_dib.h"
diff --git a/core/fxge/dib/fx_dib.cpp b/core/fxge/dib/fx_dib.cpp
index 1f67cd8..1c408b6 100644
--- a/core/fxge/dib/fx_dib.cpp
+++ b/core/fxge/dib/fx_dib.cpp
@@ -13,6 +13,10 @@
 #include "core/fxcrt/fx_extension.h"
 
 #if defined(OS_WIN)
+#include <windows.h>
+#endif
+
+#if defined(OS_WIN)
 static_assert(sizeof(FX_COLORREF) == sizeof(COLORREF),
               "FX_COLORREF vs. COLORREF mismatch");
 #endif
diff --git a/xfa/fwl/cfwl_event.h b/xfa/fwl/cfwl_event.h
index 7dca5ac..ca8adbf 100644
--- a/xfa/fwl/cfwl_event.h
+++ b/xfa/fwl/cfwl_event.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FWL_CFWL_EVENT_H_
 #define XFA_FWL_CFWL_EVENT_H_
 
-#include "core/fxcrt/fx_system.h"
 #include "v8/include/cppgc/macros.h"
 
 class CFWL_Widget;
diff --git a/xfa/fwl/cfwl_eventselectchanged.h b/xfa/fwl/cfwl_eventselectchanged.h
index 33010c0..c7ed8e4 100644
--- a/xfa/fwl/cfwl_eventselectchanged.h
+++ b/xfa/fwl/cfwl_eventselectchanged.h
@@ -7,6 +7,8 @@
 #ifndef XFA_FWL_CFWL_EVENTSELECTCHANGED_H_
 #define XFA_FWL_CFWL_EVENTSELECTCHANGED_H_
 
+#include <stdint.h>
+
 #include "xfa/fwl/cfwl_event.h"
 
 class CFWL_EventSelectChanged final : public CFWL_Event {
diff --git a/xfa/fwl/cfwl_message.h b/xfa/fwl/cfwl_message.h
index c77cc59..7a6e565 100644
--- a/xfa/fwl/cfwl_message.h
+++ b/xfa/fwl/cfwl_message.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FWL_CFWL_MESSAGE_H_
 #define XFA_FWL_CFWL_MESSAGE_H_
 
-#include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "v8/include/cppgc/macros.h"