nixpkgs/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch
Domen Kožar f4bde46b0f hhvm: use upstream patches to fix the build
(cherry picked from commit b7894032b4708a8c9ccee99aca1b7d6166546d4d)
Signed-off-by: Domen Kožar <domen@dev.si>
2014-12-13 15:28:12 +01:00

40 lines
1.3 KiB
Diff

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();