[packages/hhvm] fix for MAX macro being undefined
glen
glen at pld-linux.org
Mon Nov 17 11:24:42 CET 2014
commit 3e79618fc7a1c4dc3290d3107c945334645e8e14
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Nov 16 21:34:34 2014 +0200
fix for MAX macro being undefined
MAX.patch | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hhvm.spec | 2 ++
2 files changed, 60 insertions(+)
---
diff --git a/hhvm.spec b/hhvm.spec
index 4c47530..2bbea0b 100644
--- a/hhvm.spec
+++ b/hhvm.spec
@@ -26,6 +26,7 @@ Source7: php.ini
Source100: get-source.sh
Patch1: no-debug.patch
Patch2: hphpize.patch
+Patch3: MAX.patch
URL: https://github.com/facebook/hhvm/wiki
BuildRequires: ImageMagick-devel
BuildRequires: a52dec-libs-devel
@@ -225,6 +226,7 @@ mv folly-* third-party/folly/src
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# prefer ones from system
rm CMake/FindBISON.cmake
diff --git a/MAX.patch b/MAX.patch
new file mode 100644
index 0000000..8c03bb7
--- /dev/null
+++ b/MAX.patch
@@ -0,0 +1,58 @@
+
+https://github.com/facebook/hhvm/commit/8207a31c26cc42fee79363a14c4a8f4fcbfffe63
+
+From 8207a31c26cc42fee79363a14c4a8f4fcbfffe63 Mon Sep 17 00:00:00 2001
+From: Jordan DeLong <jdelong at fb.com>
+Date: Mon, 6 Oct 2014 18:30:28 -0700
+Subject: [PATCH] Remove some MIN/MAX macro uses in the emitter
+
+Summary: <algorithm> has preferable type-safe versions that don't double-eval
+their args.
+
+Reviewed By: @paulbiss
+
+Differential Revision: D1599803
+---
+ hphp/compiler/analysis/emitter.cpp | 6 +++---
+ hphp/util/compatibility.h | 4 ----
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/hphp/compiler/analysis/emitter.cpp b/hphp/compiler/analysis/emitter.cpp
+index 321e637..b1d3f2d 100644
+--- a/hphp/compiler/analysis/emitter.cpp
++++ b/hphp/compiler/analysis/emitter.cpp
+@@ -799,8 +799,8 @@ void SymbolicStack::push(char sym) {
+ if (sym != StackSym::W && sym != StackSym::K && sym != StackSym::L &&
+ sym != StackSym::T && sym != StackSym::I && sym != StackSym::H) {
+ m_actualStack.push_back(m_symStack.size());
+- *m_actualStackHighWaterPtr = MAX(*m_actualStackHighWaterPtr,
+- (int)m_actualStack.size());
++ *m_actualStackHighWaterPtr = std::max(*m_actualStackHighWaterPtr,
++ (int)m_actualStack.size());
+ }
+ m_symStack.push_back(SymEntry(sym));
+ }
+@@ -1010,7 +1010,7 @@ int SymbolicStack::sizeActual() const {
+
+ void SymbolicStack::pushFDesc() {
+ m_fdescCount += kNumActRecCells;
+- *m_fdescHighWaterPtr = MAX(*m_fdescHighWaterPtr, m_fdescCount);
++ *m_fdescHighWaterPtr = std::max(*m_fdescHighWaterPtr, m_fdescCount);
+ }
+
+ void SymbolicStack::popFDesc() {
+diff --git a/hphp/util/compatibility.h b/hphp/util/compatibility.h
+index 723f6c8..43f1bc8 100644
+--- a/hphp/util/compatibility.h
++++ b/hphp/util/compatibility.h
+@@ -58,10 +58,6 @@ typedef struct {
+ int dladdr(const void *addr, Dl_info *info);
+ int backtrace (void **buffer, int size);
+
+-// From sys/param.h
+-#define MIN(a,b) (((a)<(b))?(a):(b))
+-#define MAX(a,b) (((a)>(b))?(a):(b))
+-
+ #endif
+
+ //////////////////////////////////////////////////////////////////////
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/hhvm.git/commitdiff/8dff2648982fec63f8da336aaa844da64bf31c50
More information about the pld-cvs-commit
mailing list