summaryrefslogtreecommitdiff
path: root/core/fxcrt/include
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-08-02 12:07:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-02 12:07:35 -0700
commit448c4337f2be2523727451b265311d48e9550ee5 (patch)
tree44aa0bcf17c564cb8dc0e68de0426ab44cd07aa4 /core/fxcrt/include
parentea3ff9eaaa508b9cbc7f52bc92d189eacbc7a935 (diff)
downloadpdfium-448c4337f2be2523727451b265311d48e9550ee5.tar.xz
Splitting fpdfdoc/doc_* part II.
This splits the doc_ocg, doc_vt and doc_basic files into individual class files. Review-Url: https://codereview.chromium.org/2187073005
Diffstat (limited to 'core/fxcrt/include')
-rw-r--r--core/fxcrt/include/fx_system.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h
index f4fc2e819c..0542f33047 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.