summary refs log tree commit diff
path: root/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch')
-rw-r--r--pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch b/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch
new file mode 100644
index 00000000000..8ee5b31925f
--- /dev/null
+++ b/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch
@@ -0,0 +1,40 @@
+From 3918a2ccceb98230ff517601ad60aa6bee36e2c4 Mon Sep 17 00:00:00 2001
+From: Alex Malyshev <alexanderm@fb.com>
+Date: Tue, 28 Oct 2014 15:55:34 -0700
+Subject: [PATCH] Replace use of MAX macro with std::max in ZendPack
+
+Summary: This has randomly bitten me in open source builds. I intermittently get
+an error saying that MAX isn't defined.
+
+Instead of trying to figure out what's going on, I'm just gonna switch
+it to std::max.
+
+Reviewed By: @paulbiss
+
+Differential Revision: D1636740
+---
+ hphp/runtime/base/zend-pack.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hphp/runtime/base/zend-pack.cpp b/hphp/runtime/base/zend-pack.cpp
+index d878ea4..c3ee14d 100644
+--- a/hphp/runtime/base/zend-pack.cpp
++++ b/hphp/runtime/base/zend-pack.cpp
+@@ -21,6 +21,8 @@
+ #include "hphp/runtime/base/builtin-functions.h"
+ #include "hphp/util/tiny-vector.h"
+ 
++#include <algorithm>
++
+ namespace HPHP {
+ 
+ #define INC_OUTPUTPOS(a,b)                                              \
+@@ -294,7 +296,7 @@ Variant ZendPack::pack(const String& fmt, const Array& argv) {
+     case 'a':
+     case 'A':
+     case 'Z': {
+-      int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
++      int arg_cp = (code != 'Z') ? arg : std::max(0, arg - 1);
+       memset(&output[outputpos], (code != 'A') ? '\0' : ' ', arg);
+       val = argv[currentarg++].toString();
+       s = val.c_str();