Index: core/fxcrt/include/fx_system.h |
diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h |
index f4fc2e819cfec55ed7e47a8a5f1bc28e8bfbd5fa..0542f330476a905f3bd61a3df987ec4e18736a04 100644 |
--- a/core/fxcrt/include/fx_system.h |
+++ b/core/fxcrt/include/fx_system.h |
@@ -73,6 +73,11 @@ typedef int FX_BOOL; // Keep, sadly not always 0 or 1. |
typedef char FX_CHAR; // Keep, questionable signedness. |
typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. |
+#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) |
+ |
// PDFium string sizes are limited to 2^31-1, and the value is signed to |
// allow -1 as a placeholder for "unknown". |
// TODO(palmer): it should be a |size_t|, or at least unsigned. |