summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/icecat-CVE-2015-0827-pt-3.patch
blob: 8d4012684945302e460e8526a92cdeef1a5b607b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From c91087708686ae1c47abee65e19536688e5ec8f2 Mon Sep 17 00:00:00 2001
From: Ryan VanderMeulen <ryanvm@gmail.com>
Date: Mon, 26 Jan 2015 17:24:46 -0500
Subject: [PATCH] Bug 1117304 - Add missing MOZ2D_WARN_IF definition to fix
 bustage. r=milan, a=bustage

---
 gfx/2d/FilterNodeSoftware.cpp |  1 +
 gfx/2d/Logging.h              | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/gfx/2d/FilterNodeSoftware.cpp b/gfx/2d/FilterNodeSoftware.cpp
index 10d92c6..48bf162 100644
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -12,6 +12,7 @@
 #include "Blur.h"
 #include <map>
 #include "FilterProcessing.h"
+#include "Logging.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/DebugOnly.h"
 
diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h
index 85e788c..d7728bb 100644
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -155,6 +155,25 @@ typedef Log<LOG_WARNING> WarningLog;
 #define gfxWarning if (1) ; else NoLog
 #endif
 
+// See nsDebug.h and the NS_WARN_IF macro
+
+#ifdef __cplusplus
+#ifdef DEBUG
+inline bool MOZ2D_warn_if_impl(bool aCondition, const char* aExpr,
+                               const char* aFile, int32_t aLine)
+{
+  if (MOZ_UNLIKELY(aCondition)) {
+    gfxWarning() << aExpr << " at " << aFile << ":" << aLine;
+  }
+  return aCondition;
+}
+#define MOZ2D_WARN_IF(condition) \
+  MOZ2D_warn_if_impl(condition, #condition, __FILE__, __LINE__)
+#else
+#define MOZ2D_WARN_IF(condition) (bool)(condition)
+#endif
+#endif
+
 const int INDENT_PER_LEVEL = 2;
 
 class TreeLog
-- 
2.2.1