Make everything in fx_system.h start with FXSYS_

As long as we're going to have a clumsy prefix naming convention,
we might as well make it easy to grep for places where fx_system.h
is (and isn't) needed.

Change-Id: I18fe4b93aba7b9b4a32a8f39147524e9ba722a26
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/82850
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_psengine.cpp b/core/fpdfapi/page/cpdf_psengine.cpp
index 68e23b6..7bb2803 100644
--- a/core/fpdfapi/page/cpdf_psengine.cpp
+++ b/core/fpdfapi/page/cpdf_psengine.cpp
@@ -288,16 +288,16 @@
       break;
     case PSOP_SIN:
       d1 = Pop();
-      Push(sin(d1 * FX_PI / 180.0f));
+      Push(sin(d1 * FXSYS_PI / 180.0f));
       break;
     case PSOP_COS:
       d1 = Pop();
-      Push(cos(d1 * FX_PI / 180.0f));
+      Push(cos(d1 * FXSYS_PI / 180.0f));
       break;
     case PSOP_ATAN:
       d2 = Pop();
       d1 = Pop();
-      d1 = atan2(d1, d2) * 180.0 / FX_PI;
+      d1 = atan2(d1, d2) * 180.0 / FXSYS_PI;
       if (d1 < 0) {
         d1 += 360;
       }
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp
index 747cc2e..2803f15 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_security_handler.cpp
@@ -385,7 +385,7 @@
   if (buf[9] != 'a' || buf[10] != 'd' || buf[11] != 'b')
     return false;
 
-  if (FXDWORD_GET_LSBFIRST(buf) != m_Permissions)
+  if (FXSYS_DWORD_GET_LSBFIRST(buf) != m_Permissions)
     return false;
 
   // Relax this check as there appear to be some non-conforming documents
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp
index bf012f5..0e56353 100644
--- a/core/fpdfapi/render/cpdf_rendershading.cpp
+++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -196,7 +196,7 @@
   const float dy = end_y - start_y;
   const float dr = end_r - start_r;
   const float a = dx * dx + dy * dy - dr * dr;
-  const bool a_is_float_zero = IsFloatZero(a);
+  const bool a_is_float_zero = FXSYS_IsFloatZero(a);
 
   int width = pBitmap->GetWidth();
   int height = pBitmap->GetHeight();
@@ -217,7 +217,7 @@
       float b = -2 * (pos_dx * dx + pos_dy * dy + start_r * dr);
       float c = pos_dx * pos_dx + pos_dy * pos_dy - start_r * start_r;
       float s;
-      if (IsFloatZero(b)) {
+      if (FXSYS_IsFloatZero(b)) {
         s = sqrt(-c / a);
       } else if (a_is_float_zero) {
         s = -c / b;
diff --git a/core/fpdfdoc/cpdf_generateap.cpp b/core/fpdfdoc/cpdf_generateap.cpp
index d74fd91..488d504 100644
--- a/core/fpdfdoc/cpdf_generateap.cpp
+++ b/core/fpdfdoc/cpdf_generateap.cpp
@@ -1116,7 +1116,7 @@
       vt.SetProvider(&prd);
       vt.SetPlateRect(rcBody);
       vt.SetAlignment(nAlign);
-      if (IsFloatZero(fFontSize))
+      if (FXSYS_IsFloatZero(fFontSize))
         vt.SetAutoFontSize(true);
       else
         vt.SetFontSize(fFontSize);
@@ -1181,7 +1181,7 @@
       rcEdit.right = rcButton.left;
       rcEdit.Normalize();
       vt.SetPlateRect(rcEdit);
-      if (IsFloatZero(fFontSize))
+      if (FXSYS_IsFloatZero(fFontSize))
         vt.SetAutoFontSize(true);
       else
         vt.SetFontSize(fFontSize);
@@ -1223,8 +1223,8 @@
 
         CFX_PointF ptCenter = CFX_PointF((rcButton.left + rcButton.right) / 2,
                                          (rcButton.top + rcButton.bottom) / 2);
-        if (IsFloatBigger(rcButton.Width(), 6) &&
-            IsFloatBigger(rcButton.Height(), 6)) {
+        if (FXSYS_IsFloatBigger(rcButton.Width(), 6) &&
+            FXSYS_IsFloatBigger(rcButton.Height(), 6)) {
           sAppStream << "q\n"
                      << " 0 g\n";
           sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n";
@@ -1251,7 +1251,7 @@
       if (pOpts) {
         float fy = rcBody.top;
         for (size_t i = nTop, sz = pOpts->size(); i < sz; i++) {
-          if (IsFloatSmaller(fy, rcBody.bottom))
+          if (FXSYS_IsFloatSmaller(fy, rcBody.bottom))
             break;
 
           if (CPDF_Object* pOpt = pOpts->GetDirectObjectAt(i)) {
@@ -1277,7 +1277,7 @@
             vt.SetProvider(&prd);
             vt.SetPlateRect(
                 CFX_FloatRect(rcBody.left, 0.0f, rcBody.right, 0.0f));
-            vt.SetFontSize(IsFloatZero(fFontSize) ? 12.0f : fFontSize);
+            vt.SetFontSize(FXSYS_IsFloatZero(fFontSize) ? 12.0f : fFontSize);
 
             vt.Initialize();
             vt.SetText(swItem);
diff --git a/core/fpdfdoc/cpvt_section.cpp b/core/fpdfdoc/cpvt_section.cpp
index f7c62c5..713dc20 100644
--- a/core/fpdfdoc/cpvt_section.cpp
+++ b/core/fpdfdoc/cpvt_section.cpp
@@ -328,16 +328,16 @@
     float fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent -
                  m_pVT->GetLineLeading();
     float fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent;
-    if (IsFloatBigger(point.y, fTop))
+    if (FXSYS_IsFloatBigger(point.y, fTop))
       bUp = false;
-    if (IsFloatSmaller(point.y, fBottom))
+    if (FXSYS_IsFloatSmaller(point.y, fBottom))
       bDown = false;
-    if (IsFloatSmaller(point.y, fTop)) {
+    if (FXSYS_IsFloatSmaller(point.y, fTop)) {
       nRight = nMid - 1;
       nMid = (nLeft + nRight) / 2;
       continue;
     }
-    if (IsFloatBigger(point.y, fBottom)) {
+    if (FXSYS_IsFloatBigger(point.y, fBottom)) {
       nLeft = nMid + 1;
       nMid = (nLeft + nRight) / 2;
       continue;
diff --git a/core/fpdfdoc/cpvt_variabletext.cpp b/core/fpdfdoc/cpvt_variabletext.cpp
index 5d2ecab..e8f6f31 100644
--- a/core/fpdfdoc/cpvt_variabletext.cpp
+++ b/core/fpdfdoc/cpvt_variabletext.cpp
@@ -415,16 +415,16 @@
     if (!fxcrt::IndexInBounds(m_SectionArray, nMid))
       break;
     CPVT_Section* pSection = m_SectionArray[nMid].get();
-    if (IsFloatBigger(pt.y, pSection->GetRect().top))
+    if (FXSYS_IsFloatBigger(pt.y, pSection->GetRect().top))
       bUp = false;
-    if (IsFloatBigger(pSection->GetRect().bottom, pt.y))
+    if (FXSYS_IsFloatBigger(pSection->GetRect().bottom, pt.y))
       bDown = false;
-    if (IsFloatSmaller(pt.y, pSection->GetRect().top)) {
+    if (FXSYS_IsFloatSmaller(pt.y, pSection->GetRect().top)) {
       nRight = nMid - 1;
       nMid = (nLeft + nRight) / 2;
       continue;
     }
-    if (IsFloatBigger(pt.y, pSection->GetRect().bottom)) {
+    if (FXSYS_IsFloatBigger(pt.y, pSection->GetRect().bottom)) {
       nLeft = nMid + 1;
       nMid = (nLeft + nRight) / 2;
       continue;
@@ -799,8 +799,8 @@
     CFX_SizeF size = pSection->GetSectionSize(fFontSize);
     szTotal.width = std::max(size.width, szTotal.width);
     szTotal.height += size.height;
-    if (IsFloatBigger(szTotal.width, GetPlateWidth()) ||
-        IsFloatBigger(szTotal.height, GetPlateHeight())) {
+    if (FXSYS_IsFloatBigger(szTotal.width, GetPlateWidth()) ||
+        FXSYS_IsFloatBigger(szTotal.height, GetPlateHeight())) {
       return true;
     }
   }
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index d78eb21..5cf15f2 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -226,7 +226,7 @@
 
 CFX_FloatRect GetLooseBounds(const CPDF_TextPage::CharInfo& charinfo) {
   float font_size = GetFontSize(charinfo.m_pTextObj.Get());
-  if (charinfo.m_pTextObj && !IsFloatZero(font_size)) {
+  if (charinfo.m_pTextObj && !FXSYS_IsFloatZero(font_size)) {
     bool is_vert_writing = charinfo.m_pTextObj->GetFont()->IsVertWriting();
     if (is_vert_writing && charinfo.m_pTextObj->GetFont()->IsCIDFont()) {
       CPDF_CIDFont* pCIDFont = charinfo.m_pTextObj->GetFont()->AsCIDFont();
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
index b57e482..e2f2fc6 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
@@ -93,11 +93,11 @@
   }
 
   bmp_header.bfType =
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&bmp_header.bfType));
-  bmp_header.bfOffBits =
-      FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&bmp_header.bfOffBits));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&bmp_header.bfType));
+  bmp_header.bfOffBits = FXSYS_DWORD_GET_LSBFIRST(
+      reinterpret_cast<uint8_t*>(&bmp_header.bfOffBits));
   data_size_ =
-      FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&bmp_header.bfSize));
+      FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&bmp_header.bfSize));
   if (bmp_header.bfType != kBmpSignature)
     return BmpDecoder::Status::kFail;
 
@@ -110,7 +110,7 @@
     return BmpDecoder::Status::kFail;
 
   img_ifh_size_ =
-      FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_ifh_size_));
+      FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_ifh_size_));
   pal_type_ = 0;
   BmpDecoder::Status status = ReadBmpHeaderIfh();
   if (status != BmpDecoder::Status::kSuccess)
@@ -128,11 +128,11 @@
       return BmpDecoder::Status::kContinue;
     }
 
-    width_ = FXWORD_GET_LSBFIRST(
+    width_ = FXSYS_WORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_core_header.bcWidth));
-    height_ = FXWORD_GET_LSBFIRST(
+    height_ = FXSYS_WORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_core_header.bcHeight));
-    bit_counts_ = FXWORD_GET_LSBFIRST(
+    bit_counts_ = FXSYS_WORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_core_header.bcBitCount));
     compress_flag_ = kBmpRgb;
     img_tb_flag_ = false;
@@ -146,19 +146,19 @@
       return BmpDecoder::Status::kContinue;
     }
 
-    width_ = FXDWORD_GET_LSBFIRST(
+    width_ = FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biWidth));
-    int32_t signed_height = FXDWORD_GET_LSBFIRST(
+    int32_t signed_height = FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biHeight));
-    bit_counts_ = FXWORD_GET_LSBFIRST(
+    bit_counts_ = FXSYS_WORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biBitCount));
-    compress_flag_ = FXDWORD_GET_LSBFIRST(
+    compress_flag_ = FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biCompression));
-    color_used_ = FXDWORD_GET_LSBFIRST(
+    color_used_ = FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biClrUsed));
-    dpi_x_ = static_cast<int32_t>(FXDWORD_GET_LSBFIRST(
+    dpi_x_ = static_cast<int32_t>(FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biXPelsPerMeter)));
-    dpi_y_ = static_cast<int32_t>(FXDWORD_GET_LSBFIRST(
+    dpi_y_ = static_cast<int32_t>(FXSYS_DWORD_GET_LSBFIRST(
         reinterpret_cast<uint8_t*>(&bmp_info_header.biYPelsPerMeter)));
     if (!SetHeight(signed_height))
       return BmpDecoder::Status::kFail;
@@ -183,21 +183,21 @@
     return BmpDecoder::Status::kContinue;
 
   uint16_t bi_planes;
-  width_ = FXDWORD_GET_LSBFIRST(
+  width_ = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biWidth));
-  int32_t signed_height = FXDWORD_GET_LSBFIRST(
+  int32_t signed_height = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biHeight));
-  bit_counts_ = FXWORD_GET_LSBFIRST(
+  bit_counts_ = FXSYS_WORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biBitCount));
-  compress_flag_ = FXDWORD_GET_LSBFIRST(
+  compress_flag_ = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biCompression));
-  color_used_ = FXDWORD_GET_LSBFIRST(
+  color_used_ = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biClrUsed));
-  bi_planes = FXWORD_GET_LSBFIRST(
+  bi_planes = FXSYS_WORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biPlanes));
-  dpi_x_ = FXDWORD_GET_LSBFIRST(
+  dpi_x_ = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biXPelsPerMeter));
-  dpi_y_ = FXDWORD_GET_LSBFIRST(
+  dpi_y_ = FXSYS_DWORD_GET_LSBFIRST(
       reinterpret_cast<uint8_t*>(&bmp_info_header.biYPelsPerMeter));
   if (!SetHeight(signed_height))
     return BmpDecoder::Status::kFail;
@@ -273,9 +273,9 @@
   if (!ReadData(reinterpret_cast<uint8_t*>(masks), sizeof(masks)))
     return BmpDecoder::Status::kContinue;
 
-  mask_red_ = FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[0]));
-  mask_green_ = FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[1]));
-  mask_blue_ = FXDWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[2]));
+  mask_red_ = FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[0]));
+  mask_green_ = FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[1]));
+  mask_blue_ = FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&masks[2]));
   if (mask_red_ & mask_green_ || mask_red_ & mask_blue_ ||
       mask_green_ & mask_blue_) {
     return BmpDecoder::Status::kFail;
@@ -411,7 +411,7 @@
         green_bits -= 8;
         red_bits -= 8;
         for (uint32_t col = 0; col < width_; ++col) {
-          *buf = FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(buf));
+          *buf = FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(buf));
           out_row_buffer_[idx++] =
               static_cast<uint8_t>((*buf & mask_blue_) << blue_bits);
           out_row_buffer_[idx++] =
diff --git a/core/fxcodec/gif/cfx_gifcontext.cpp b/core/fxcodec/gif/cfx_gifcontext.cpp
index eb50065..30e4038 100644
--- a/core/fxcodec/gif/cfx_gifcontext.cpp
+++ b/core/fxcodec/gif/cfx_gifcontext.cpp
@@ -387,9 +387,9 @@
   }
 
   width_ = static_cast<int>(
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&lsd.width)));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&lsd.width)));
   height_ = static_cast<int>(
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&lsd.height)));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&lsd.height)));
 
   return GifDecoder::Status::kSuccess;
 }
@@ -431,8 +431,8 @@
             std::make_unique<CFX_GifGraphicControlExtension>();
       graphic_control_extension_->block_size = gif_gce.block_size;
       graphic_control_extension_->gce_flags = gif_gce.gce_flags;
-      graphic_control_extension_->delay_time =
-          FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&gif_gce.delay_time));
+      graphic_control_extension_->delay_time = FXSYS_WORD_GET_LSBFIRST(
+          reinterpret_cast<uint8_t*>(&gif_gce.delay_time));
       graphic_control_extension_->trans_index = gif_gce.trans_index;
       break;
     }
@@ -461,13 +461,13 @@
 
   auto gif_image = std::make_unique<CFX_GifImage>();
   gif_image->image_info.left =
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.left));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.left));
   gif_image->image_info.top =
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.top));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.top));
   gif_image->image_info.width =
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.width));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.width));
   gif_image->image_info.height =
-      FXWORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.height));
+      FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<uint8_t*>(&img_info.height));
   gif_image->image_info.local_flags = img_info.local_flags;
   if (gif_image->image_info.left + gif_image->image_info.width > width_ ||
       gif_image->image_info.top + gif_image->image_info.height > height_)
diff --git a/core/fxcrt/byteorder_unittest.cpp b/core/fxcrt/byteorder_unittest.cpp
index 20f7a12..7b86acf 100644
--- a/core/fxcrt/byteorder_unittest.cpp
+++ b/core/fxcrt/byteorder_unittest.cpp
@@ -10,16 +10,16 @@
 
 // Original code to use as a reference implementation.
 
-#define FXWORD_GET_LSBFIRST(p)                                \
+#define FXSYS_WORD_GET_LSBFIRST(p)                            \
   (static_cast<uint16_t>((static_cast<uint16_t>(p[1]) << 8) | \
                          (static_cast<uint16_t>(p[0]))))
-#define FXWORD_GET_MSBFIRST(p)                                \
+#define FXSYS_WORD_GET_MSBFIRST(p)                            \
   (static_cast<uint16_t>((static_cast<uint16_t>(p[0]) << 8) | \
                          (static_cast<uint16_t>(p[1]))))
-#define FXDWORD_GET_LSBFIRST(p)                                                \
+#define FXSYS_DWORD_GET_LSBFIRST(p)                                            \
   ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \
    (static_cast<uint32_t>(p[1]) << 8) | (static_cast<uint32_t>(p[0])))
-#define FXDWORD_GET_MSBFIRST(p)                                                \
+#define FXSYS_DWORD_GET_MSBFIRST(p)                                            \
   ((static_cast<uint32_t>(p[0]) << 24) | (static_cast<uint32_t>(p[1]) << 16) | \
    (static_cast<uint32_t>(p[2]) << 8) | (static_cast<uint32_t>(p[3])))
 
@@ -37,7 +37,7 @@
   for (uint32_t v = 0; v < 0x10000; ++v) {
     const uint16_t v16 = v;
     uint16_t expected =
-        FXWORD_GET_LSBFIRST(reinterpret_cast<const uint8_t*>(&v16));
+        FXSYS_WORD_GET_LSBFIRST(reinterpret_cast<const uint8_t*>(&v16));
     EXPECT_EQ(expected, ByteSwapToLE16(v16)) << v;
   }
 }
@@ -45,7 +45,7 @@
 TEST(ByteOrder, ByteSwapToLE32) {
   for (uint32_t v : kTestValues32) {
     uint32_t expected =
-        FXDWORD_GET_LSBFIRST(reinterpret_cast<const uint8_t*>(&v));
+        FXSYS_DWORD_GET_LSBFIRST(reinterpret_cast<const uint8_t*>(&v));
     EXPECT_EQ(expected, ByteSwapToLE32(v)) << v;
   }
 }
@@ -55,7 +55,7 @@
   for (uint32_t v = 0; v < 0x10000; ++v) {
     const uint16_t v16 = v;
     uint16_t expected =
-        FXWORD_GET_MSBFIRST(reinterpret_cast<const uint8_t*>(&v16));
+        FXSYS_WORD_GET_MSBFIRST(reinterpret_cast<const uint8_t*>(&v16));
     EXPECT_EQ(expected, ByteSwapToBE16(v16)) << v;
   }
 }
@@ -63,7 +63,7 @@
 TEST(ByteOrder, ByteSwapToBE32) {
   for (uint32_t v : kTestValues32) {
     uint32_t expected =
-        FXDWORD_GET_MSBFIRST(reinterpret_cast<const uint8_t*>(&v));
+        FXSYS_DWORD_GET_MSBFIRST(reinterpret_cast<const uint8_t*>(&v));
     EXPECT_EQ(expected, ByteSwapToBE32(v)) << v;
   }
 }
diff --git a/core/fxcrt/fx_coordinates_unittest.cpp b/core/fxcrt/fx_coordinates_unittest.cpp
index d1673f5..9d2b057 100644
--- a/core/fxcrt/fx_coordinates_unittest.cpp
+++ b/core/fxcrt/fx_coordinates_unittest.cpp
@@ -458,11 +458,11 @@
 #define EXPECT_NEAR_FIVE_PLACES(a, b) EXPECT_NEAR((a), (b), 1e-5)
 
 TEST(CFX_Matrix, ComposeTransformations) {
-  // sin(FX_PI/2) and cos(FX_PI/2) have a tiny error and are not exactly 1.0f
-  // and 0.0f. The rotation matrix is thus not perfect.
+  // sin(FXSYS_PI/2) and cos(FXSYS_PI/2) have a tiny error and are not
+  // exactly 1.0f and 0.0f. The rotation matrix is thus not perfect.
 
   CFX_Matrix rotate_90;
-  rotate_90.Rotate(FX_PI / 2);
+  rotate_90.Rotate(FXSYS_PI / 2);
   EXPECT_NEAR_FIVE_PLACES(0.0f, rotate_90.a);
   EXPECT_NEAR_FIVE_PLACES(1.0f, rotate_90.b);
   EXPECT_NEAR_FIVE_PLACES(-1.0f, rotate_90.c);
@@ -586,7 +586,7 @@
 
 TEST(CFX_Matrix, TransformRectForRectF) {
   CFX_Matrix rotate_90;
-  rotate_90.Rotate(FX_PI / 2);
+  rotate_90.Rotate(FXSYS_PI / 2);
 
   CFX_Matrix scale_5_13;
   scale_5_13.Scale(5, 13);
@@ -607,7 +607,7 @@
 
 TEST(CFX_Matrix, TransformRectForFloatRect) {
   CFX_Matrix rotate_90;
-  rotate_90.Rotate(FX_PI / 2);
+  rotate_90.Rotate(FXSYS_PI / 2);
 
   CFX_Matrix scale_5_13;
   scale_5_13.Scale(5, 13);
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h
index 0720e15..c17df4d 100644
--- a/core/fxcrt/fx_system.h
+++ b/core/fxcrt/fx_system.h
@@ -33,14 +33,16 @@
 extern "C" {
 #endif  // __cplusplus
 
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb))
+#define FXSYS_IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define FXSYS_IsFloatBigger(fa, fb) \
+  ((fa) > (fb) && !FXSYS_IsFloatZero((fa) - (fb)))
+#define FXSYS_IsFloatSmaller(fa, fb) \
+  ((fa) < (fb) && !FXSYS_IsFloatZero((fa) - (fb)))
+#define FXSYS_IsFloatEqual(fa, fb) FXSYS_IsFloatZero((fa) - (fb))
 
 // M_PI not universally present on all platforms.
-#define FX_PI 3.1415926535897932384626433832795f
-#define FX_BEZIER 0.5522847498308f
+#define FXSYS_PI 3.1415926535897932384626433832795f
+#define FXSYS_BEZIER 0.5522847498308f
 
 // NOTE: prevent use of the return value from snprintf() since some platforms
 // have different return values.
@@ -125,16 +127,16 @@
 uint32_t FXSYS_GetLastError();
 #endif  // defined(OS_WIN)
 
-#define FXWORD_GET_LSBFIRST(p)                                \
+#define FXSYS_WORD_GET_LSBFIRST(p)                            \
   (static_cast<uint16_t>((static_cast<uint16_t>(p[1]) << 8) | \
                          (static_cast<uint16_t>(p[0]))))
-#define FXWORD_GET_MSBFIRST(p)                                \
+#define FXSYS_WORD_GET_MSBFIRST(p)                            \
   (static_cast<uint16_t>((static_cast<uint16_t>(p[0]) << 8) | \
                          (static_cast<uint16_t>(p[1]))))
-#define FXDWORD_GET_LSBFIRST(p)                                                \
+#define FXSYS_DWORD_GET_LSBFIRST(p)                                            \
   ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \
    (static_cast<uint32_t>(p[1]) << 8) | (static_cast<uint32_t>(p[0])))
-#define FXDWORD_GET_MSBFIRST(p)                                                \
+#define FXSYS_DWORD_GET_MSBFIRST(p)                                            \
   ((static_cast<uint32_t>(p[0]) << 24) | (static_cast<uint32_t>(p[1]) << 16) | \
    (static_cast<uint32_t>(p[2]) << 8) | (static_cast<uint32_t>(p[3])))
 int32_t FXSYS_atoi(const char* str);
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 910cb4c..04a27ea 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -990,7 +990,7 @@
     font.setEmbolden(m_isSubstFontBold);
     font.setHinting(SkFontHinting::kNone);
     font.setScaleX(m_scaleX);
-    font.setSkewX(tanf(m_italicAngle * FX_PI / 180.0));
+    font.setSkewX(tanf(m_italicAngle * FXSYS_PI / 180.0));
     font.setSize(SkTAbs(m_fontSize));
     font.setSubpixel(true);
     font.setEdging(GetFontEdgingType(m_textOptions));
@@ -1721,7 +1721,7 @@
   font.setHinting(SkFontHinting::kNone);
   font.setSize(SkTAbs(font_size));
   font.setSubpixel(true);
-  font.setSkewX(tanf(pFont->GetSubstFontItalicAngle() * FX_PI / 180.0));
+  font.setSkewX(tanf(pFont->GetSubstFontItalicAngle() * FXSYS_PI / 180.0));
   font.setEdging(GetFontEdgingType(options));
 
   SkAutoCanvasRestore scoped_save_restore(m_pCanvas, /*doSave=*/true);
diff --git a/core/fxge/win32/cwin32_platform.cpp b/core/fxge/win32/cwin32_platform.cpp
index 70240b6..b609f1f 100644
--- a/core/fxge/win32/cwin32_platform.cpp
+++ b/core/fxge/win32/cwin32_platform.cpp
@@ -394,7 +394,7 @@
                                         uint32_t table,
                                         pdfium::span<uint8_t> buffer) {
   HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
-  table = FXDWORD_GET_MSBFIRST(reinterpret_cast<uint8_t*>(&table));
+  table = FXSYS_DWORD_GET_MSBFIRST(reinterpret_cast<uint8_t*>(&table));
   uint32_t size = ::GetFontData(m_hDC, table, 0, buffer.data(), buffer.size());
   ::SelectObject(m_hDC, hOldFont);
   if (size == GDI_ERROR) {
diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
index 6a77c61..1112451 100644
--- a/fpdfsdk/cpdfsdk_appstream.cpp
+++ b/fpdfsdk/cpdfsdk_appstream.cpp
@@ -175,11 +175,11 @@
     float px2 = pts[i][2].x - pts[nNext][0].x;
     float py2 = pts[i][2].y - pts[nNext][0].y;
 
-    csAP << pts[i][0].x + px1 * FX_BEZIER << " "
-         << pts[i][0].y + py1 * FX_BEZIER << " "
-         << pts[nNext][0].x + px2 * FX_BEZIER << " "
-         << pts[nNext][0].y + py2 * FX_BEZIER << " " << pts[nNext][0].x << " "
-         << pts[nNext][0].y << " " << kCurveToOperator << "\n";
+    csAP << pts[i][0].x + px1 * FXSYS_BEZIER << " "
+         << pts[i][0].y + py1 * FXSYS_BEZIER << " "
+         << pts[nNext][0].x + px2 * FXSYS_BEZIER << " "
+         << pts[nNext][0].y + py2 * FXSYS_BEZIER << " " << pts[nNext][0].x
+         << " " << pts[nNext][0].y << " " << kCurveToOperator << "\n";
   }
 
   return ByteString(csAP);
@@ -201,29 +201,29 @@
   float px = pt2.x - pt1.x;
   float py = pt2.y - pt1.y;
 
-  csAP << pt1.x << " " << pt1.y + py * FX_BEZIER << " "
-       << pt2.x - px * FX_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y
-       << " " << kCurveToOperator << "\n";
+  csAP << pt1.x << " " << pt1.y + py * FXSYS_BEZIER << " "
+       << pt2.x - px * FXSYS_BEZIER << " " << pt2.y << " " << pt2.x << " "
+       << pt2.y << " " << kCurveToOperator << "\n";
 
   px = pt3.x - pt2.x;
   py = pt2.y - pt3.y;
 
-  csAP << pt2.x + px * FX_BEZIER << " " << pt2.y << " " << pt3.x << " "
-       << pt3.y + py * FX_BEZIER << " " << pt3.x << " " << pt3.y << " "
+  csAP << pt2.x + px * FXSYS_BEZIER << " " << pt2.y << " " << pt3.x << " "
+       << pt3.y + py * FXSYS_BEZIER << " " << pt3.x << " " << pt3.y << " "
        << kCurveToOperator << "\n";
 
   px = pt3.x - pt4.x;
   py = pt3.y - pt4.y;
 
-  csAP << pt3.x << " " << pt3.y - py * FX_BEZIER << " "
-       << pt4.x + px * FX_BEZIER << " " << pt4.y << " " << pt4.x << " " << pt4.y
-       << " " << kCurveToOperator << "\n";
+  csAP << pt3.x << " " << pt3.y - py * FXSYS_BEZIER << " "
+       << pt4.x + px * FXSYS_BEZIER << " " << pt4.y << " " << pt4.x << " "
+       << pt4.y << " " << kCurveToOperator << "\n";
 
   px = pt4.x - pt1.x;
   py = pt1.y - pt4.y;
 
-  csAP << pt4.x - px * FX_BEZIER << " " << pt4.y << " " << pt1.x << " "
-       << pt1.y - py * FX_BEZIER << " " << pt1.x << " " << pt1.y << " "
+  csAP << pt4.x - px * FXSYS_BEZIER << " " << pt4.y << " " << pt1.x << " "
+       << pt1.y - py * FXSYS_BEZIER << " " << pt1.x << " " << pt1.y << " "
        << kCurveToOperator << "\n";
 
   return ByteString(csAP);
@@ -277,16 +277,16 @@
 ByteString GetAP_Star(const CFX_FloatRect& crBBox) {
   std::ostringstream csAP;
 
-  float fRadius = (crBBox.top - crBBox.bottom) / (1 + cosf(FX_PI / 5.0f));
+  float fRadius = (crBBox.top - crBBox.bottom) / (1 + cosf(FXSYS_PI / 5.0f));
   CFX_PointF ptCenter = CFX_PointF((crBBox.left + crBBox.right) / 2.0f,
                                    (crBBox.top + crBBox.bottom) / 2.0f);
 
   CFX_PointF points[5];
-  float fAngle = FX_PI / 10.0f;
+  float fAngle = FXSYS_PI / 10.0f;
   for (auto& point : points) {
     point =
         ptCenter + CFX_PointF(fRadius * cosf(fAngle), fRadius * sinf(fAngle));
-    fAngle += FX_PI * 2 / 5.0f;
+    fAngle += FXSYS_PI * 2 / 5.0f;
   }
 
   csAP << points[0].x << " " << points[0].y << " " << kMoveToOperator << "\n";
@@ -323,15 +323,15 @@
   px = pt2.x - pt1.x;
   py = pt2.y - pt1.y;
 
-  csAP << pt1.x << " " << pt1.y + py * FX_BEZIER << " "
-       << pt2.x - px * FX_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y
-       << " " << kCurveToOperator << "\n";
+  csAP << pt1.x << " " << pt1.y + py * FXSYS_BEZIER << " "
+       << pt2.x - px * FXSYS_BEZIER << " " << pt2.y << " " << pt2.x << " "
+       << pt2.y << " " << kCurveToOperator << "\n";
 
   px = pt3.x - pt2.x;
   py = pt2.y - pt3.y;
 
-  csAP << pt2.x + px * FX_BEZIER << " " << pt2.y << " " << pt3.x << " "
-       << pt3.y + py * FX_BEZIER << " " << pt3.x << " " << pt3.y << " "
+  csAP << pt2.x + px * FXSYS_BEZIER << " " << pt2.y << " " << pt3.x << " "
+       << pt3.y + py * FXSYS_BEZIER << " " << pt3.x << " " << pt3.y << " "
        << kCurveToOperator << "\n";
 
   return ByteString(csAP);
@@ -469,7 +469,7 @@
         if (sColor.GetLength() > 0) {
           AutoClosedQCommand q2(&sAppStream);
           sAppStream << fHalfWidth << " " << kSetLineWidthOperator << "\n"
-                     << sColor << GetAP_HalfCircle(rect_by_75, FX_PI / 4.0f)
+                     << sColor << GetAP_HalfCircle(rect_by_75, FXSYS_PI / 4.0f)
                      << " " << kStrokeOperator << "\n";
         }
 
@@ -477,8 +477,9 @@
         if (sColor.GetLength() > 0) {
           AutoClosedQCommand q2(&sAppStream);
           sAppStream << fHalfWidth << " " << kSetLineWidthOperator << "\n"
-                     << sColor << GetAP_HalfCircle(rect_by_75, FX_PI * 5 / 4.0f)
-                     << " " << kStrokeOperator << "\n";
+                     << sColor
+                     << GetAP_HalfCircle(rect_by_75, FXSYS_PI * 5 / 4.0f) << " "
+                     << kStrokeOperator << "\n";
         }
       } break;
       case BorderStyle::kInset: {
@@ -494,7 +495,7 @@
         if (sColor.GetLength() > 0) {
           AutoClosedQCommand q2(&sAppStream);
           sAppStream << fHalfWidth << " " << kSetLineWidthOperator << "\n"
-                     << sColor << GetAP_HalfCircle(rect_by_75, FX_PI / 4.0f)
+                     << sColor << GetAP_HalfCircle(rect_by_75, FXSYS_PI / 4.0f)
                      << " " << kStrokeOperator << "\n";
         }
 
@@ -502,8 +503,9 @@
         if (sColor.GetLength() > 0) {
           AutoClosedQCommand q2(&sAppStream);
           sAppStream << fHalfWidth << " " << kSetLineWidthOperator << "\n"
-                     << sColor << GetAP_HalfCircle(rect_by_75, FX_PI * 5 / 4.0f)
-                     << " " << kStrokeOperator << "\n";
+                     << sColor
+                     << GetAP_HalfCircle(rect_by_75, FXSYS_PI * 5 / 4.0f) << " "
+                     << kStrokeOperator << "\n";
         }
       } break;
     }
@@ -673,7 +675,7 @@
   std::ostringstream sAppStream;
   if (sEditStream.tellp() > 0) {
     float fCharSpace = pEdit->GetCharSpace();
-    if (!IsFloatZero(fCharSpace))
+    if (!FXSYS_IsFloatZero(fCharSpace))
       sAppStream << fCharSpace << " " << kSetCharacterSpacingOperator << "\n";
 
     sAppStream << sEditStream.str();
@@ -745,7 +747,7 @@
   pEdit->SetAlignmentV(1);
   pEdit->SetMultiLine(false);
   pEdit->SetAutoReturn(false);
-  if (IsFloatZero(fFontSize))
+  if (FXSYS_IsFloatZero(fFontSize))
     pEdit->SetAutoFontSize(true);
   else
     pEdit->SetFontSize(fFontSize);
@@ -769,7 +771,7 @@
       break;
     case ButtonStyle::kIconTopLabelBottom:
       if (pIconStream) {
-        if (IsFloatZero(fFontSize)) {
+        if (FXSYS_IsFloatZero(fFontSize)) {
           fHeight = rcBBox.Height();
           rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right,
                                   rcBBox.bottom + fHeight * fAutoFontScale);
@@ -793,7 +795,7 @@
       break;
     case ButtonStyle::kIconBottomLabelTop:
       if (pIconStream) {
-        if (IsFloatZero(fFontSize)) {
+        if (FXSYS_IsFloatZero(fFontSize)) {
           fHeight = rcBBox.Height();
           rcLabel =
               CFX_FloatRect(rcBBox.left, rcBBox.top - fHeight * fAutoFontScale,
@@ -818,7 +820,7 @@
       break;
     case ButtonStyle::kIconLeftLabelRight:
       if (pIconStream) {
-        if (IsFloatZero(fFontSize)) {
+        if (FXSYS_IsFloatZero(fFontSize)) {
           fWidth = rcBBox.right - rcBBox.left;
           if (rcLabelContent.Width() < fWidth * fAutoFontScale) {
             rcLabel = CFX_FloatRect(rcBBox.right - fWidth * fAutoFontScale,
@@ -852,7 +854,7 @@
       break;
     case ButtonStyle::kIconRightLabelLeft:
       if (pIconStream) {
-        if (IsFloatZero(fFontSize)) {
+        if (FXSYS_IsFloatZero(fFontSize)) {
           fWidth = rcBBox.right - rcBBox.left;
           if (rcLabelContent.Width() < fWidth * fAutoFontScale) {
             rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom,
@@ -1071,8 +1073,8 @@
 
   CFX_PointF ptCenter = CFX_PointF((rcBBox.left + rcBBox.right) / 2,
                                    (rcBBox.top + rcBBox.bottom) / 2);
-  if (IsFloatBigger(rcBBox.right - rcBBox.left, 6) &&
-      IsFloatBigger(rcBBox.top - rcBBox.bottom, 6)) {
+  if (FXSYS_IsFloatBigger(rcBBox.right - rcBBox.left, 6) &&
+      FXSYS_IsFloatBigger(rcBBox.top - rcBBox.bottom, 6)) {
     AutoClosedQCommand q(&sAppStream);
     sAppStream << " 0 " << kSetGrayOperator << "\n"
                << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " "
@@ -1546,7 +1548,7 @@
   pEdit->SetAlignmentV(1);
 
   float fFontSize = widget_->GetFontSize();
-  if (IsFloatZero(fFontSize))
+  if (FXSYS_IsFloatZero(fFontSize))
     pEdit->SetAutoFontSize(true);
   else
     pEdit->SetFontSize(fFontSize);
@@ -1607,7 +1609,7 @@
   pEdit->SetPlateRect(CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f));
 
   float fFontSize = widget_->GetFontSize();
-  pEdit->SetFontSize(IsFloatZero(fFontSize) ? 12.0f : fFontSize);
+  pEdit->SetFontSize(FXSYS_IsFloatZero(fFontSize) ? 12.0f : fFontSize);
   pEdit->Initialize();
 
   std::ostringstream sList;
@@ -1721,7 +1723,7 @@
   if (nMaxLen > 0) {
     if (bCharArray) {
       pEdit->SetCharArray(nMaxLen);
-      if (IsFloatZero(fFontSize)) {
+      if (FXSYS_IsFloatZero(fFontSize)) {
         fFontSize = CPWL_Edit::GetCharArrayAutoFontSize(
             font_map.GetPDFFont(0).Get(), rcClient, nMaxLen);
       }
@@ -1732,7 +1734,7 @@
     }
   }
 
-  if (IsFloatZero(fFontSize))
+  if (FXSYS_IsFloatZero(fFontSize))
     pEdit->SetAutoFontSize(true);
   else
     pEdit->SetFontSize(fFontSize);
diff --git a/fpdfsdk/fpdf_text.cpp b/fpdfsdk/fpdf_text.cpp
index dc6a457..ce9c040 100644
--- a/fpdfsdk/fpdf_text.cpp
+++ b/fpdfsdk/fpdf_text.cpp
@@ -197,7 +197,7 @@
   // Calculate the angle of the vector
   float angle = atan2f(charinfo.m_Matrix.c, charinfo.m_Matrix.a);
   if (angle < 0)
-    angle = 2 * FX_PI + angle;
+    angle = 2 * FXSYS_PI + angle;
 
   return angle;
 }
diff --git a/fpdfsdk/fpdf_text_embeddertest.cpp b/fpdfsdk/fpdf_text_embeddertest.cpp
index 4b653bd..cc541cc 100644
--- a/fpdfsdk/fpdf_text_embeddertest.cpp
+++ b/fpdfsdk/fpdf_text_embeddertest.cpp
@@ -1360,15 +1360,15 @@
                   FPDFText_GetCharAngle(text_page, kHelloGoodbyeTextSize + 1));
 
   // Test GetCharAngle for every quadrant
-  EXPECT_NEAR(FX_PI / 4.0, FPDFText_GetCharAngle(text_page, 0), 0.001);
-  EXPECT_NEAR(3 * FX_PI / 4.0,
+  EXPECT_NEAR(FXSYS_PI / 4.0, FPDFText_GetCharAngle(text_page, 0), 0.001);
+  EXPECT_NEAR(3 * FXSYS_PI / 4.0,
               FPDFText_GetCharAngle(text_page, kSubstringsSize[0]), 0.001);
   EXPECT_NEAR(
-      5 * FX_PI / 4.0,
+      5 * FXSYS_PI / 4.0,
       FPDFText_GetCharAngle(text_page, kSubstringsSize[0] + kSubstringsSize[1]),
       0.001);
   EXPECT_NEAR(
-      7 * FX_PI / 4.0,
+      7 * FXSYS_PI / 4.0,
       FPDFText_GetCharAngle(text_page, kSubstringsSize[0] + kSubstringsSize[1] +
                                            kSubstringsSize[2]),
       0.001);
diff --git a/fpdfsdk/pwl/cpwl_cbbutton.cpp b/fpdfsdk/pwl/cpwl_cbbutton.cpp
index bea9785..a16b26a 100644
--- a/fpdfsdk/pwl/cpwl_cbbutton.cpp
+++ b/fpdfsdk/pwl/cpwl_cbbutton.cpp
@@ -33,8 +33,10 @@
   constexpr float kComboBoxTriangleLength = 6.0f;
   constexpr float kComboBoxTriangleHalfLength = kComboBoxTriangleLength / 2;
   constexpr float kComboBoxTriangleQuarterLength = kComboBoxTriangleLength / 4;
-  if (!IsFloatBigger(window.right - window.left, kComboBoxTriangleLength) ||
-      !IsFloatBigger(window.top - window.bottom, kComboBoxTriangleHalfLength)) {
+  if (!FXSYS_IsFloatBigger(window.right - window.left,
+                           kComboBoxTriangleLength) ||
+      !FXSYS_IsFloatBigger(window.top - window.bottom,
+                           kComboBoxTriangleHalfLength)) {
     return;
   }
 
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index 7ea7c57..f96dbce 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -290,7 +290,7 @@
   if (bPopup == m_bPopup)
     return true;
   float fListHeight = m_pList->GetContentRect().Height();
-  if (!IsFloatBigger(fListHeight, 0.0f))
+  if (!FXSYS_IsFloatBigger(fListHeight, 0.0f))
     return true;
 
   if (!bPopup) {
@@ -317,7 +317,7 @@
   float fPopupRet;
   m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPopupMin, fPopupMax,
                                    &bBottom, &fPopupRet);
-  if (!IsFloatBigger(fPopupRet, 0.0f))
+  if (!FXSYS_IsFloatBigger(fPopupRet, 0.0f))
     return true;
 
   m_rcOldWindow = CPWL_Wnd::GetWindowRect();
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index a696776..f54692f 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -1121,7 +1121,7 @@
     return;
 
   if (m_pVT->IsValid()) {
-    if (!IsFloatEqual(m_ptScrollPos.x, fx)) {
+    if (!FXSYS_IsFloatEqual(m_ptScrollPos.x, fx)) {
       m_ptScrollPos.x = fx;
       Refresh();
     }
@@ -1133,7 +1133,7 @@
     return;
 
   if (m_pVT->IsValid()) {
-    if (!IsFloatEqual(m_ptScrollPos.y, fy)) {
+    if (!FXSYS_IsFloatEqual(m_ptScrollPos.y, fy)) {
       m_ptScrollPos.y = fy;
       Refresh();
 
@@ -1167,10 +1167,10 @@
     if (rcPlate.Width() > rcContent.Width()) {
       SetScrollPosX(rcPlate.left);
     } else {
-      if (IsFloatSmaller(m_ptScrollPos.x, rcContent.left)) {
+      if (FXSYS_IsFloatSmaller(m_ptScrollPos.x, rcContent.left)) {
         SetScrollPosX(rcContent.left);
-      } else if (IsFloatBigger(m_ptScrollPos.x,
-                               rcContent.right - rcPlate.Width())) {
+      } else if (FXSYS_IsFloatBigger(m_ptScrollPos.x,
+                                     rcContent.right - rcPlate.Width())) {
         SetScrollPosX(rcContent.right - rcPlate.Width());
       }
     }
@@ -1178,10 +1178,10 @@
     if (rcPlate.Height() > rcContent.Height()) {
       SetScrollPosY(rcPlate.top);
     } else {
-      if (IsFloatSmaller(m_ptScrollPos.y,
-                         rcContent.bottom + rcPlate.Height())) {
+      if (FXSYS_IsFloatSmaller(m_ptScrollPos.y,
+                               rcContent.bottom + rcPlate.Height())) {
         SetScrollPosY(rcContent.bottom + rcPlate.Height());
-      } else if (IsFloatBigger(m_ptScrollPos.y, rcContent.top)) {
+      } else if (FXSYS_IsFloatBigger(m_ptScrollPos.y, rcContent.top)) {
         SetScrollPosY(rcContent.top);
       }
     }
@@ -1216,23 +1216,23 @@
   CFX_PointF ptHeadEdit = VTToEdit(ptHead);
   CFX_PointF ptFootEdit = VTToEdit(ptFoot);
   CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
-  if (!IsFloatEqual(rcPlate.left, rcPlate.right)) {
-    if (IsFloatSmaller(ptHeadEdit.x, rcPlate.left) ||
-        IsFloatEqual(ptHeadEdit.x, rcPlate.left)) {
+  if (!FXSYS_IsFloatEqual(rcPlate.left, rcPlate.right)) {
+    if (FXSYS_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) ||
+        FXSYS_IsFloatEqual(ptHeadEdit.x, rcPlate.left)) {
       SetScrollPosX(ptHead.x);
-    } else if (IsFloatBigger(ptHeadEdit.x, rcPlate.right)) {
+    } else if (FXSYS_IsFloatBigger(ptHeadEdit.x, rcPlate.right)) {
       SetScrollPosX(ptHead.x - rcPlate.Width());
     }
   }
 
-  if (!IsFloatEqual(rcPlate.top, rcPlate.bottom)) {
-    if (IsFloatSmaller(ptFootEdit.y, rcPlate.bottom) ||
-        IsFloatEqual(ptFootEdit.y, rcPlate.bottom)) {
-      if (IsFloatSmaller(ptHeadEdit.y, rcPlate.top)) {
+  if (!FXSYS_IsFloatEqual(rcPlate.top, rcPlate.bottom)) {
+    if (FXSYS_IsFloatSmaller(ptFootEdit.y, rcPlate.bottom) ||
+        FXSYS_IsFloatEqual(ptFootEdit.y, rcPlate.bottom)) {
+      if (FXSYS_IsFloatSmaller(ptHeadEdit.y, rcPlate.top)) {
         SetScrollPosY(ptFoot.y + rcPlate.Height());
       }
-    } else if (IsFloatBigger(ptHeadEdit.y, rcPlate.top)) {
-      if (IsFloatBigger(ptFootEdit.y, rcPlate.bottom)) {
+    } else if (FXSYS_IsFloatBigger(ptHeadEdit.y, rcPlate.top)) {
+      if (FXSYS_IsFloatBigger(ptFootEdit.y, rcPlate.bottom)) {
         SetScrollPosY(ptHead.y);
       }
     }
@@ -1846,11 +1846,11 @@
     CFX_FloatRect rcContent = m_pVT->GetContentRect();
 
     if (m_pVT->IsMultiLine() && GetTotalLines() > 1 &&
-        IsFloatBigger(rcContent.Height(), rcPlate.Height())) {
+        FXSYS_IsFloatBigger(rcContent.Height(), rcPlate.Height())) {
       return true;
     }
 
-    if (IsFloatBigger(rcContent.Width(), rcPlate.Width()))
+    if (FXSYS_IsFloatBigger(rcContent.Width(), rcPlate.Width()))
       return true;
   }
 
diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp
index c1b1910..df9f9ea 100644
--- a/fpdfsdk/pwl/cpwl_list_box.cpp
+++ b/fpdfsdk/pwl/cpwl_list_box.cpp
@@ -267,8 +267,10 @@
   if (!pScroll)
     return;
 
-  if (IsFloatBigger(Info.fPlateWidth, Info.fContentMax - Info.fContentMin) ||
-      IsFloatEqual(Info.fPlateWidth, Info.fContentMax - Info.fContentMin)) {
+  if (FXSYS_IsFloatBigger(Info.fPlateWidth,
+                          Info.fContentMax - Info.fContentMin) ||
+      FXSYS_IsFloatEqual(Info.fPlateWidth,
+                         Info.fContentMax - Info.fContentMin)) {
     if (pScroll->IsVisible()) {
       pScroll->SetVisible(false);
       RePosChildWnd();
diff --git a/fpdfsdk/pwl/cpwl_list_ctrl.cpp b/fpdfsdk/pwl/cpwl_list_ctrl.cpp
index cd0faf5..7885946 100644
--- a/fpdfsdk/pwl/cpwl_list_ctrl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_ctrl.cpp
@@ -423,12 +423,12 @@
   CFX_FloatRect rcItem = GetItemRectInternal(nItemIndex);
   CFX_FloatRect rcItemCtrl = GetItemRect(nItemIndex);
 
-  if (IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom)) {
-    if (IsFloatSmaller(rcItemCtrl.top, rcPlate.top)) {
+  if (FXSYS_IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom)) {
+    if (FXSYS_IsFloatSmaller(rcItemCtrl.top, rcPlate.top)) {
       SetScrollPosY(rcItem.bottom + rcPlate.Height());
     }
-  } else if (IsFloatBigger(rcItemCtrl.top, rcPlate.top)) {
-    if (IsFloatBigger(rcItemCtrl.bottom, rcPlate.bottom)) {
+  } else if (FXSYS_IsFloatBigger(rcItemCtrl.top, rcPlate.top)) {
+    if (FXSYS_IsFloatBigger(rcItemCtrl.bottom, rcPlate.bottom)) {
       SetScrollPosY(rcItem.top);
     }
   }
@@ -454,16 +454,16 @@
 }
 
 void CPWL_ListCtrl::SetScrollPosY(float fy) {
-  if (!IsFloatEqual(m_ptScrollPos.y, fy)) {
+  if (!FXSYS_IsFloatEqual(m_ptScrollPos.y, fy)) {
     CFX_FloatRect rcPlate = m_rcPlate;
     CFX_FloatRect rcContent = GetContentRectInternal();
 
     if (rcPlate.Height() > rcContent.Height()) {
       fy = rcPlate.top;
     } else {
-      if (IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom)) {
+      if (FXSYS_IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom)) {
         fy = rcContent.bottom + rcPlate.Height();
-      } else if (IsFloatBigger(fy, rcContent.top)) {
+      } else if (FXSYS_IsFloatBigger(fy, rcContent.top)) {
         fy = rcContent.top;
       }
     }
@@ -534,9 +534,9 @@
   bool bLast = true;
   for (const auto& pListItem : m_ListItems) {
     CFX_FloatRect rcListItem = pListItem->GetRect();
-    if (IsFloatBigger(pt.y, rcListItem.top))
+    if (FXSYS_IsFloatBigger(pt.y, rcListItem.top))
       bFirst = false;
-    if (IsFloatSmaller(pt.y, rcListItem.bottom))
+    if (FXSYS_IsFloatSmaller(pt.y, rcListItem.bottom))
       bLast = false;
     if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom)
       return &pListItem - &m_ListItems.front();
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index 1a14224..17ebec8 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -34,8 +34,8 @@
 }
 
 bool PWL_FLOATRANGE::In(float x) const {
-  return (IsFloatBigger(x, fMin) || IsFloatEqual(x, fMin)) &&
-         (IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
+  return (FXSYS_IsFloatBigger(x, fMin) || FXSYS_IsFloatEqual(x, fMin)) &&
+         (FXSYS_IsFloatSmaller(x, fMax) || FXSYS_IsFloatEqual(x, fMax));
 }
 
 float PWL_FLOATRANGE::GetWidth() const {
@@ -57,9 +57,9 @@
 void PWL_SCROLL_PRIVATEDATA::SetScrollRange(float min, float max) {
   ScrollRange.Set(min, max);
 
-  if (IsFloatSmaller(fScrollPos, ScrollRange.fMin))
+  if (FXSYS_IsFloatSmaller(fScrollPos, ScrollRange.fMin))
     fScrollPos = ScrollRange.fMin;
-  if (IsFloatBigger(fScrollPos, ScrollRange.fMax))
+  if (FXSYS_IsFloatBigger(fScrollPos, ScrollRange.fMax))
     fScrollPos = ScrollRange.fMax;
 }
 
@@ -127,8 +127,8 @@
   CFX_FloatRect rcClient = GetClientRect();
   CFX_FloatRect rcMinButton;
   CFX_FloatRect rcMaxButton;
-  if (IsFloatBigger(rcClient.top - rcClient.bottom,
-                    kButtonWidth * 2 + kPosButtonMinWidth + 2)) {
+  if (FXSYS_IsFloatBigger(rcClient.top - rcClient.bottom,
+                          kButtonWidth * 2 + kPosButtonMinWidth + 2)) {
     rcMinButton = CFX_FloatRect(rcClient.left, rcClient.top - kButtonWidth,
                                 rcClient.right, rcClient.top);
     rcMaxButton = CFX_FloatRect(rcClient.left, rcClient.bottom, rcClient.right,
@@ -136,7 +136,7 @@
   } else {
     float fBWidth =
         (rcClient.top - rcClient.bottom - kPosButtonMinWidth - 2) / 2;
-    if (IsFloatBigger(fBWidth, 0)) {
+    if (FXSYS_IsFloatBigger(fBWidth, 0)) {
       rcMinButton = CFX_FloatRect(rcClient.left, rcClient.top - fBWidth,
                                   rcClient.right, rcClient.top);
       rcMaxButton = CFX_FloatRect(rcClient.left, rcClient.bottom,
@@ -334,7 +334,7 @@
   m_sData.SetScrollRange(fMin, fMax);
   m_sData.SetClientWidth(fClientWidth);
 
-  if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f)) {
+  if (FXSYS_IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f)) {
     m_pPosButton->SetVisible(false);
     // Note, |this| may no longer be viable at this point. If more work needs
     // to be done, check thisObserved.
@@ -352,7 +352,7 @@
 void CPWL_ScrollBar::SetScrollPos(float fPos) {
   float fOldPos = m_sData.fScrollPos;
   m_sData.SetPos(fPos);
-  if (!IsFloatEqual(m_sData.fScrollPos, fOldPos)) {
+  if (!FXSYS_IsFloatEqual(m_sData.fScrollPos, fOldPos)) {
     MovePosButton(true);
     // Note, |this| may no longer be viable at this point. If more work needs
     // to be done, check the return value of MovePosButton().
@@ -373,10 +373,10 @@
     float fBottom = TrueToFace(m_sData.fScrollPos + m_sData.fClientWidth);
     float fTop = TrueToFace(m_sData.fScrollPos);
 
-    if (IsFloatSmaller(fTop - fBottom, kPosButtonMinWidth))
+    if (FXSYS_IsFloatSmaller(fTop - fBottom, kPosButtonMinWidth))
       fBottom = fTop - kPosButtonMinWidth;
 
-    if (IsFloatSmaller(fBottom, rcPosArea.bottom)) {
+    if (FXSYS_IsFloatSmaller(fBottom, rcPosArea.bottom)) {
       fBottom = rcPosArea.bottom;
       fTop = fBottom + kPosButtonMinWidth;
     }
@@ -442,17 +442,17 @@
   float fOldScrollPos = m_sData.fScrollPos;
   float fNewPos = FaceToTrue(m_fOldPosButton + point.y - m_nOldPos);
   if (m_bMouseDown) {
-    if (IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin)) {
+    if (FXSYS_IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin)) {
       fNewPos = m_sData.ScrollRange.fMin;
     }
 
-    if (IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax)) {
+    if (FXSYS_IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax)) {
       fNewPos = m_sData.ScrollRange.fMax;
     }
 
     m_sData.SetPos(fNewPos);
 
-    if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos)) {
+    if (!FXSYS_IsFloatEqual(fOldScrollPos, m_sData.fScrollPos)) {
       if (!MovePosButton(true))
         return;
 
diff --git a/third_party/agg23/0000-bug-466.patch b/third_party/agg23/0000-bug-466.patch
index e761198..5d62dcf 100644
--- a/third_party/agg23/0000-bug-466.patch
+++ b/third_party/agg23/0000-bug-466.patch
@@ -8,11 +8,11 @@
      out_vertices.add(coord_type(x + dx1, y + dy1));
 -    if(!ccw) {
 -        if(a1 > a2) {
--            a2 += 2 * FX_PI;
+-            a2 += 2 * FXSYS_PI;
 +    if (da > 0) {
 +      if (!ccw) {
 +        if (a1 > a2) {
-+          a2 += 2 * FX_PI;
++          a2 += 2 * FXSYS_PI;
          }
          a2 -= da / 4;
          a1 += da;
@@ -25,10 +25,10 @@
          }
 -    } else {
 -        if(a1 < a2) {
--            a2 -= 2 * FX_PI;
+-            a2 -= 2 * FXSYS_PI;
 +      } else {
 +        if (a1 < a2) {
-+          a2 -= 2 * FX_PI;
++          a2 -= 2 * FXSYS_PI;
          }
          a2 += da / 4;
          a1 -= da;
diff --git a/third_party/agg23/0009-infinite-loop.patch b/third_party/agg23/0009-infinite-loop.patch
index d1c22d8..ffa540f 100644
--- a/third_party/agg23/0009-infinite-loop.patch
+++ b/third_party/agg23/0009-infinite-loop.patch
@@ -4,7 +4,7 @@
 +++ b/third_party/agg23/agg_math_stroke.h
 @@ -173,6 +173,9 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
        float a1 = atan2(dy1, -dx1);
-       float a2 = a1 + FX_PI;
+       float a2 = a1 + FXSYS_PI;
        float da = acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
 +      if (da < stroke_theta) {
 +        da = stroke_theta;
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index 70d1f2c..e1d5fda 100644
--- a/third_party/agg23/agg_math_stroke.h
+++ b/third_party/agg23/agg_math_stroke.h
@@ -56,7 +56,7 @@
     float a1 = atan2(dy1, dx1);
     float a2 = atan2(dy2, dx2);
     float da = a1 - a2;
-    bool ccw = da > 0 && da < FX_PI;
+    bool ccw = da > 0 && da < FXSYS_PI;
     if(width < 0) {
         width = -width;
     }
@@ -65,7 +65,7 @@
     if (da > 0) {
       if (!ccw) {
         if (a1 > a2) {
-          a2 += 2 * FX_PI;
+          a2 += 2 * FXSYS_PI;
         }
         a2 -= da / 4;
         a1 += da;
@@ -76,7 +76,7 @@
         }
       } else {
         if (a1 < a2) {
-          a2 -= 2 * FX_PI;
+          a2 -= 2 * FXSYS_PI;
         }
         a2 += da / 4;
         a1 -= da;
@@ -171,7 +171,7 @@
         out_vertices.add(coord_type(v0.x + dx1 - dx2, v0.y - dy1 - dy2));
     } else {
       float a1 = atan2(dy1, -dx1);
-      float a2 = a1 + FX_PI;
+      float a2 = a1 + FXSYS_PI;
       float da = acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
       if (da < stroke_theta) {
         da = stroke_theta;
diff --git a/xfa/fgas/graphics/cfgas_gepath.cpp b/xfa/fgas/graphics/cfgas_gepath.cpp
index 39ca530..fcb1382 100644
--- a/xfa/fgas/graphics/cfgas_gepath.cpp
+++ b/xfa/fgas/graphics/cfgas_gepath.cpp
@@ -85,7 +85,7 @@
 }
 
 void CFGAS_GEPath::AddEllipse(const CFX_RectF& rect) {
-  AddArc(rect.TopLeft(), rect.Size(), 0, FX_PI * 2);
+  AddArc(rect.TopLeft(), rect.Size(), 0, FXSYS_PI * 2);
 }
 
 void CFGAS_GEPath::AddArc(const CFX_PointF& original_pos,
@@ -96,14 +96,14 @@
     return;
 
   const float bezier_arc_angle_epsilon = 0.01f;
-  while (start_angle > FX_PI * 2)
-    start_angle -= FX_PI * 2;
+  while (start_angle > FXSYS_PI * 2)
+    start_angle -= FXSYS_PI * 2;
   while (start_angle < 0)
-    start_angle += FX_PI * 2;
-  if (sweep_angle >= FX_PI * 2)
-    sweep_angle = FX_PI * 2;
-  if (sweep_angle <= -FX_PI * 2)
-    sweep_angle = -FX_PI * 2;
+    start_angle += FXSYS_PI * 2;
+  if (sweep_angle >= FXSYS_PI * 2)
+    sweep_angle = FXSYS_PI * 2;
+  if (sweep_angle <= -FXSYS_PI * 2)
+    sweep_angle = -FXSYS_PI * 2;
 
   CFX_SizeF size = original_size / 2;
   CFX_PointF pos(original_pos.x + size.width, original_pos.y + size.height);
@@ -118,16 +118,16 @@
   do {
     if (sweep_angle < 0) {
       prev_sweep = total_sweep;
-      local_sweep = -FX_PI / 2;
-      total_sweep -= FX_PI / 2;
+      local_sweep = -FXSYS_PI / 2;
+      total_sweep -= FXSYS_PI / 2;
       if (total_sweep <= sweep_angle + bezier_arc_angle_epsilon) {
         local_sweep = sweep_angle - prev_sweep;
         done = true;
       }
     } else {
       prev_sweep = total_sweep;
-      local_sweep = FX_PI / 2;
-      total_sweep += FX_PI / 2;
+      local_sweep = FXSYS_PI / 2;
+      total_sweep += FXSYS_PI / 2;
       if (total_sweep >= sweep_angle - bezier_arc_angle_epsilon) {
         local_sweep = sweep_angle - prev_sweep;
         done = true;
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index ee4e4e4..0730014 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -22,8 +22,8 @@
 
 CFX_PointF ScaleBezierPoint(const CFX_PointF& point) {
   CFX_PointF scaled_point(point);
-  scaled_point.x *= FX_BEZIER;
-  scaled_point.y *= FX_BEZIER;
+  scaled_point.x *= FXSYS_BEZIER;
+  scaled_point.y *= FXSYS_BEZIER;
   return scaled_point;
 }
 
@@ -126,16 +126,16 @@
                                    const CFX_Matrix& matrix) {
   CFGAS_GEPath path;
   float fBottom = rtSign.bottom();
-  float fRadius = (rtSign.top - fBottom) / (1 + cosf(FX_PI / 5.0f));
+  float fRadius = (rtSign.top - fBottom) / (1 + cosf(FXSYS_PI / 5.0f));
   CFX_PointF ptCenter((rtSign.left + rtSign.right()) / 2.0f,
                       (rtSign.top + fBottom) / 2.0f);
 
   CFX_PointF points[5];
-  float fAngle = FX_PI / 10.0f;
+  float fAngle = FXSYS_PI / 10.0f;
   for (auto& point : points) {
     point =
         ptCenter + CFX_PointF(fRadius * cosf(fAngle), fRadius * sinf(fAngle));
-    fAngle += FX_PI * 2 / 5.0f;
+    fAngle += FXSYS_PI * 2 / 5.0f;
   }
 
   path.MoveTo(points[0]);
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index ff00a0d..a2ea10d 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -263,8 +263,8 @@
   }
 
   fillPath->AddArc(rtDraw.TopLeft(), rtDraw.Size(),
-                   -startAngle.value_or(0) * FX_PI / 180.0f,
-                   -sweepAngle.value_or(360) * FX_PI / 180.0f);
+                   -startAngle.value_or(0) * FXSYS_PI / 180.0f,
+                   -sweepAngle.value_or(360) * FXSYS_PI / 180.0f);
 }
 
 void CXFA_Box::StrokeArcOrRounded(CFGAS_GEGraphics* pGS,
@@ -323,27 +323,27 @@
   rtWidget.height = b + b;
 
   CFGAS_GEPath arcPath;
-  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f,
-                 FX_PI);
+  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FXSYS_PI / 4.0f,
+                 FXSYS_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFF808080));
   pGS->StrokePath(arcPath, matrix);
   arcPath.Clear();
-  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
-                 FX_PI);
+  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FXSYS_PI / 4.0f,
+                 FXSYS_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFFFFFFFF));
   pGS->StrokePath(arcPath, matrix);
   rtWidget.Deflate(fHalf, fHalf);
   arcPath.Clear();
-  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f,
-                 FX_PI);
+  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FXSYS_PI / 4.0f,
+                 FXSYS_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFF404040));
   pGS->StrokePath(arcPath, matrix);
   arcPath.Clear();
-  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f,
-                 FX_PI);
+  arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FXSYS_PI / 4.0f,
+                 FXSYS_PI);
 
   pGS->SetStrokeColor(CFGAS_GEColor(0xFFC0C0C0));
   pGS->StrokePath(arcPath, matrix);
diff --git a/xfa/fxfa/parser/cxfa_rectangle.cpp b/xfa/fxfa/parser/cxfa_rectangle.cpp
index 7ecd4c5..d02d20f 100644
--- a/xfa/fxfa/parser/cxfa_rectangle.cpp
+++ b/xfa/fxfa/parser/cxfa_rectangle.cpp
@@ -120,7 +120,7 @@
     bool bInverted = corner1->IsInverted();
     bool bRound = corner1->GetJoinType() == XFA_AttributeValue::Round;
     if (bRound) {
-      sy = FX_PI / 2;
+      sy = FXSYS_PI / 2;
     }
     switch (i) {
       case 0:
@@ -131,7 +131,7 @@
         nx = -1;
         ny = 0;
         if (bRound) {
-          sx = bInverted ? FX_PI / 2 : FX_PI;
+          sx = bInverted ? FXSYS_PI / 2 : FXSYS_PI;
         } else {
           sx = 1;
           sy = 0;
@@ -145,7 +145,7 @@
         nx = 0;
         ny = -1;
         if (bRound) {
-          sx = bInverted ? FX_PI : FX_PI * 3 / 2;
+          sx = bInverted ? FXSYS_PI : FXSYS_PI * 3 / 2;
         } else {
           sx = 0;
           sy = 1;
@@ -159,7 +159,7 @@
         nx = 1;
         ny = 0;
         if (bRound) {
-          sx = bInverted ? FX_PI * 3 / 2 : 0;
+          sx = bInverted ? FXSYS_PI * 3 / 2 : 0;
         } else {
           sx = -1;
           sy = 0;
@@ -173,7 +173,7 @@
         nx = 0;
         ny = 1;
         if (bRound) {
-          sx = bInverted ? 0 : FX_PI / 2;
+          sx = bInverted ? 0 : FXSYS_PI / 2;
         } else {
           sx = 0;
           sy = -1;
@@ -185,7 +185,7 @@
 
     if (bRound) {
       if (fRadius1 < 0)
-        sx -= FX_PI;
+        sx -= FXSYS_PI;
       if (bInverted)
         sy *= -1;
 
@@ -503,7 +503,7 @@
   CFX_PointF cp1;
   CFX_PointF cp2;
   if (bRound)
-    sy = FX_PI / 2;
+    sy = FXSYS_PI / 2;
 
   switch (nIndex) {
     case 0:
@@ -524,7 +524,7 @@
       nx = -1;
       ny = 0;
       if (bRound) {
-        sx = bInverted ? FX_PI / 2 : FX_PI;
+        sx = bInverted ? FXSYS_PI / 2 : FXSYS_PI;
       } else {
         sx = 1;
         sy = 0;
@@ -548,7 +548,7 @@
       nx = 0;
       ny = -1;
       if (bRound) {
-        sx = bInverted ? FX_PI : FX_PI * 3 / 2;
+        sx = bInverted ? FXSYS_PI : FXSYS_PI * 3 / 2;
       } else {
         sx = 0;
         sy = 1;
@@ -572,7 +572,7 @@
       nx = 1;
       ny = 0;
       if (bRound) {
-        sx = bInverted ? FX_PI * 3 / 2 : 0;
+        sx = bInverted ? FXSYS_PI * 3 / 2 : 0;
       } else {
         sx = -1;
         sy = 0;
@@ -596,7 +596,7 @@
       nx = 0;
       ny = 1;
       if (bRound) {
-        sx = bInverted ? 0 : FX_PI / 2;
+        sx = bInverted ? 0 : FXSYS_PI / 2;
       } else {
         sx = 0;
         sy = -1;
@@ -613,7 +613,7 @@
   }
   if (bRound) {
     if (fRadius1 < 0)
-      sx -= FX_PI;
+      sx -= FXSYS_PI;
     if (bInverted)
       sy *= -1;