forked from udalov/protobuf261
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protobuf261.rb
70 lines (58 loc) · 1.96 KB
/
protobuf261.rb
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class Protobuf261 < Formula
desc "Protocol buffers - Google data interchange format"
homepage "https://github.com/google/protobuf/"
url "https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2"
sha256 "ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910"
# Fixes the unexpected identifier error when compiling software against protobuf:
# https://github.com/google/protobuf/issues/549
patch :p1, :DATA
conflicts_with "protobuf", :because => "Differing versions of same formula"
# this will double the build time approximately if enabled
option "with-check", "Run build-time check"
def install
# Don't build in debug mode. See:
# https://github.com/Homebrew/homebrew/issues/9279
# http://code.google.com/p/protobuf/source/browse/trunk/configure.ac#61
ENV.prepend "CXXFLAGS", "-DNDEBUG"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-zlib"
system "make"
system "make", "check" if (build.with? "check") || build.bottle?
system "make", "install"
# Install editor support and examples
doc.install "editors", "examples"
end
def caveats; <<-EOS
Editor support and examples have been installed to:
#{doc}
EOS
end
test do
testdata =
<<-EOS
package test;
message TestCase {
required string name = 4;
}
message Test {
repeated TestCase case = 1;
}
EOS
(testpath/"test.proto").write(testdata)
system bin/"protoc", "test.proto", "--cpp_out=."
end
end
__END__
diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h
index 67afc77..504d5fe 100644
--- a/src/google/protobuf/descriptor.h
+++ b/src/google/protobuf/descriptor.h
@@ -59,6 +59,9 @@
#include <vector>
#include <google/protobuf/stubs/common.h>
+#ifdef TYPE_BOOL
+#undef TYPE_BOOL
+#endif
namespace google {
namespace protobuf {