aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/README.md3
-rw-r--r--csharp/keys/Google.Protobuf.snkbin0 -> 596 bytes
-rw-r--r--csharp/keys/README.md6
-rw-r--r--csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj2
-rw-r--r--csharp/src/Google.Protobuf/Google.Protobuf.csproj2
-rw-r--r--js/binary/proto_test.js101
-rw-r--r--js/jasmine.json3
-rw-r--r--js/package.json2
-rw-r--r--ruby/Gemfile.lock6
-rw-r--r--ruby/Rakefile11
-rw-r--r--ruby/google-protobuf.gemspec11
-rw-r--r--ruby/lib/google/protobuf.rb6
-rw-r--r--src/google/protobuf/io/coded_stream.h6
-rw-r--r--src/google/protobuf/stubs/port.h2
14 files changed, 42 insertions, 119 deletions
diff --git a/cmake/README.md b/cmake/README.md
index 58aae8e9..1e7410d8 100644
--- a/cmake/README.md
+++ b/cmake/README.md
@@ -157,7 +157,8 @@ And wait for the compilation to finish.
Testing
=======
-To run unit-tests:
+To run unit-tests, first you must compile protobuf as described above.
+Then run:
C:\Path\to\protobuf\cmake\build\release>nmake check
diff --git a/csharp/keys/Google.Protobuf.snk b/csharp/keys/Google.Protobuf.snk
new file mode 100644
index 00000000..7515443c
--- /dev/null
+++ b/csharp/keys/Google.Protobuf.snk
Binary files differ
diff --git a/csharp/keys/README.md b/csharp/keys/README.md
index 1a014198..ede67357 100644
--- a/csharp/keys/README.md
+++ b/csharp/keys/README.md
@@ -2,4 +2,8 @@ Contents
--------
- Google.Protobuf.public.snk:
- Public key to verify strong name of Google.Protobuf assemblies. \ No newline at end of file
+ Public key to verify strong name of Google.Protobuf assemblies.
+- Google.Protobuf.snk:
+ Signing key to provide strong name of Google.Protobuf assemblies.
+ As per [Microsoft guidance](https://msdn.microsoft.com/en-us/library/wd40t7ad(v=vs.110).aspx)
+ signing key should be checked into the repository.
diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
index 20ae8e48..4f37c5e2 100644
--- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
+++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
@@ -55,7 +55,7 @@
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<Prefer32Bit>false</Prefer32Bit>
<SignAssembly>True</SignAssembly>
- <AssemblyOriginatorKeyFile>C:\keys\Google.Protobuf.snk</AssemblyOriginatorKeyFile>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.Protobuf.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index 45ef8c63..ef524baf 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -64,7 +64,7 @@
<NoStdLib>true</NoStdLib>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<SignAssembly>True</SignAssembly>
- <AssemblyOriginatorKeyFile>C:\keys\Google.Protobuf.snk</AssemblyOriginatorKeyFile>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.Protobuf.snk</AssemblyOriginatorKeyFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
diff --git a/js/binary/proto_test.js b/js/binary/proto_test.js
index 32d8412f..1cb7ff0e 100644
--- a/js/binary/proto_test.js
+++ b/js/binary/proto_test.js
@@ -67,10 +67,6 @@ function fillAllFields(msg) {
submsg.setC(16);
msg.setOptionalForeignMessage(submsg);
msg.setOptionalForeignEnum(proto.jspb.test.ForeignEnum.FOREIGN_FOO);
- msg.setOptionalInt32String('-12345');
- msg.setOptionalUint32String('12345');
- msg.setOptionalInt64String('-123456789012345');
- msg.setOptionalUint64String('987654321098765');
msg.setOneofString('oneof');
msg.setRepeatedInt32List([-42]);
@@ -108,15 +104,6 @@ function fillAllFields(msg) {
msg.setPackedRepeatedFloatList([1.5]);
msg.setPackedRepeatedDoubleList([-1.5]);
msg.setPackedRepeatedBoolList([true]);
-
- msg.setRepeatedInt32StringList(['-12345']);
- msg.setRepeatedUint32StringList(['12345']);
- msg.setRepeatedInt64StringList(['-123456789012345']);
- msg.setRepeatedUint64StringList(['987654321098765']);
- msg.setPackedRepeatedInt32StringList(['-12345']);
- msg.setPackedRepeatedUint32StringList(['12345']);
- msg.setPackedRepeatedInt64StringList(['-123456789012345']);
- msg.setPackedRepeatedUint64StringList(['987654321098765']);
}
@@ -173,10 +160,6 @@ function checkAllFields(msg) {
assertEquals(msg.getOptionalForeignMessage().getC(), 16);
assertEquals(msg.getOptionalForeignEnum(),
proto.jspb.test.ForeignEnum.FOREIGN_FOO);
- assertEquals(msg.getOptionalInt32String(), '-12345');
- assertEquals(msg.getOptionalUint32String(), '12345');
- assertEquals(msg.getOptionalInt64String(), '-123456789012345');
- assertEquals(msg.getOptionalUint64String(), '987654321098765');
assertEquals(msg.getOneofString(), 'oneof');
assertEquals(msg.getOneofFieldCase(),
proto.jspb.test.TestAllTypes.OneofFieldCase.ONEOF_STRING);
@@ -221,26 +204,6 @@ function checkAllFields(msg) {
assertElementsEquals(msg.getPackedRepeatedFloatList(), [1.5]);
assertElementsEquals(msg.getPackedRepeatedDoubleList(), [-1.5]);
assertElementsEquals(msg.getPackedRepeatedBoolList(), [true]);
-
- assertEquals(msg.getRepeatedInt32StringList().length, 1);
- assertElementsEquals(msg.getRepeatedInt32StringList(), ['-12345']);
- assertEquals(msg.getRepeatedUint32StringList().length, 1);
- assertElementsEquals(msg.getRepeatedUint32StringList(), ['12345']);
- assertEquals(msg.getRepeatedInt64StringList().length, 1);
- assertElementsEquals(msg.getRepeatedInt64StringList(), ['-123456789012345']);
- assertEquals(msg.getRepeatedUint64StringList().length, 1);
- assertElementsEquals(msg.getRepeatedUint64StringList(), ['987654321098765']);
-
- assertEquals(msg.getPackedRepeatedInt32StringList().length, 1);
- assertElementsEquals(msg.getPackedRepeatedInt32StringList(), ['-12345']);
- assertEquals(msg.getPackedRepeatedUint32StringList().length, 1);
- assertElementsEquals(msg.getPackedRepeatedUint32StringList(), ['12345']);
- assertEquals(msg.getPackedRepeatedInt64StringList().length, 1);
- assertElementsEquals(msg.getPackedRepeatedInt64StringList(),
- ['-123456789012345']);
- assertEquals(msg.getPackedRepeatedUint64StringList().length, 1);
- assertElementsEquals(msg.getPackedRepeatedUint64StringList(),
- ['987654321098765']);
}
@@ -285,14 +248,6 @@ function checkExtensions(msg) {
proto.jspb.test.ExtendsWithMessage.optionalExtension).getFoo());
assertEquals(proto.jspb.test.ForeignEnum.FOREIGN_FOO,
msg.getExtension(proto.jspb.test.extendOptionalForeignEnum));
- assertEquals('-12345',
- msg.getExtension(proto.jspb.test.extendOptionalInt32String));
- assertEquals('12345',
- msg.getExtension(proto.jspb.test.extendOptionalUint32String));
- assertEquals('-123456789012345',
- msg.getExtension(proto.jspb.test.extendOptionalInt64String));
- assertEquals('987654321098765',
- msg.getExtension(proto.jspb.test.extendOptionalUint64String));
assertElementsEquals(
msg.getExtension(proto.jspb.test.extendRepeatedInt32List),
@@ -349,19 +304,6 @@ function checkExtensions(msg) {
[proto.jspb.test.ForeignEnum.FOREIGN_FOO]);
assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendRepeatedInt32StringList),
- ['-12345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendRepeatedUint32StringList),
- ['12345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendRepeatedInt64StringList),
- ['-123456789012345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendRepeatedUint64StringList),
- ['987654321098765']);
-
- assertElementsEquals(
msg.getExtension(proto.jspb.test.extendPackedRepeatedInt32List),
[-42]);
assertElementsEquals(
@@ -403,19 +345,6 @@ function checkExtensions(msg) {
assertElementsEquals(
msg.getExtension(proto.jspb.test.extendPackedRepeatedForeignEnumList),
[proto.jspb.test.ForeignEnum.FOREIGN_FOO]);
-
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendPackedRepeatedInt32StringList),
- ['-12345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendPackedRepeatedUint32StringList),
- ['12345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendPackedRepeatedInt64StringList),
- ['-123456789012345']);
- assertElementsEquals(
- msg.getExtension(proto.jspb.test.extendPackedRepeatedUint64StringList),
- ['987654321098765']);
}
@@ -475,14 +404,6 @@ describe('protoBinaryTest', function() {
msg.setExtension(
proto.jspb.test.extendOptionalForeignEnum,
proto.jspb.test.ForeignEnum.FOREIGN_FOO);
- msg.setExtension(
- proto.jspb.test.extendOptionalInt32String, '-12345');
- msg.setExtension(
- proto.jspb.test.extendOptionalUint32String, '12345');
- msg.setExtension(
- proto.jspb.test.extendOptionalInt64String, '-123456789012345');
- msg.setExtension(
- proto.jspb.test.extendOptionalUint64String, '987654321098765');
msg.setExtension(
proto.jspb.test.extendRepeatedInt32List, [-42]);
@@ -522,15 +443,6 @@ describe('protoBinaryTest', function() {
[proto.jspb.test.ForeignEnum.FOREIGN_FOO]);
msg.setExtension(
- proto.jspb.test.extendRepeatedInt32StringList, ['-12345']);
- msg.setExtension(
- proto.jspb.test.extendRepeatedUint32StringList, ['12345']);
- msg.setExtension(
- proto.jspb.test.extendRepeatedInt64StringList, ['-123456789012345']);
- msg.setExtension(
- proto.jspb.test.extendRepeatedUint64StringList, ['987654321098765']);
-
- msg.setExtension(
proto.jspb.test.extendPackedRepeatedInt32List, [-42]);
msg.setExtension(
proto.jspb.test.extendPackedRepeatedInt64List, [-0x7fffffff00000000]);
@@ -559,19 +471,6 @@ describe('protoBinaryTest', function() {
proto.jspb.test.extendPackedRepeatedBoolList, [true]);
msg.setExtension(proto.jspb.test.extendPackedRepeatedForeignEnumList,
[proto.jspb.test.ForeignEnum.FOREIGN_FOO]);
-
- msg.setExtension(
- proto.jspb.test.extendPackedRepeatedInt32StringList,
- ['-12345']);
- msg.setExtension(
- proto.jspb.test.extendPackedRepeatedUint32StringList,
- ['12345']);
- msg.setExtension(
- proto.jspb.test.extendPackedRepeatedInt64StringList,
- ['-123456789012345']);
- msg.setExtension(
- proto.jspb.test.extendPackedRepeatedUint64StringList,
- ['987654321098765']);
}
diff --git a/js/jasmine.json b/js/jasmine.json
index 05444550..f83c54c0 100644
--- a/js/jasmine.json
+++ b/js/jasmine.json
@@ -1,7 +1,8 @@
{
"spec_dir": "",
"spec_files": [
- "*_test.js"
+ "*_test.js",
+ "binary/*_test.js"
],
"helpers": [
"node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js",
diff --git a/js/package.json b/js/package.json
index 316be316..be93286f 100644
--- a/js/package.json
+++ b/js/package.json
@@ -4,7 +4,7 @@
"description": "Protocol Buffers for JavaScript",
"main": "debug.js",
"dependencies": {
- "google-closure-library": "~20151015.0.0",
+ "google-closure-library": "~20160125.0.0",
"gulp": "~3.9.0",
"jasmine": "~2.4.1"
},
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock
index 8599da75..27e57506 100644
--- a/ruby/Gemfile.lock
+++ b/ruby/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- google-protobuf (3.0.0.alpha.4.0)
+ google-protobuf (3.0.0.alpha.5.0)
GEM
remote: https://rubygems.org/
@@ -10,6 +10,7 @@ GEM
rake (10.4.2)
rake-compiler (0.9.5)
rake
+ rake-compiler-dock (0.5.1)
rubygems-tasks (0.2.4)
test-unit (3.0.9)
power_assert
@@ -21,8 +22,9 @@ PLATFORMS
DEPENDENCIES
google-protobuf!
rake-compiler
+ rake-compiler-dock
rubygems-tasks
test-unit
BUNDLED WITH
- 1.10.6
+ 1.11.2
diff --git a/ruby/Rakefile b/ruby/Rakefile
index c25103d8..81c3119e 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -20,6 +20,17 @@ else
Rake::ExtensionTask.new("protobuf_c", spec) do |ext|
ext.ext_dir = "ext/google/protobuf_c"
ext.lib_dir = "lib/google"
+ ext.cross_compile = true
+ ext.cross_platform = [
+ 'x86-mingw32', 'x64-mingw32',
+ 'x86_64-linux', 'x86-linux',
+ 'universal-darwin'
+ ]
+ end
+
+ task 'gem:windows' do
+ require 'rake_compiler_dock'
+ RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6"
end
end
diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec
index 312a0c8c..7b64ee77 100644
--- a/ruby/google-protobuf.gemspec
+++ b/ruby/google-protobuf.gemspec
@@ -8,12 +8,13 @@ Gem::Specification.new do |s|
s.authors = ["Protobuf Authors"]
s.email = "protobuf@googlegroups.com"
s.require_paths = ["lib"]
- s.files = `git ls-files -z`.split("\x0").find_all{|f| f =~ /lib\/.+\.rb/}
- unless RUBY_PLATFORM == "java"
- s.files += `git ls-files "*.c" "*.h" extconf.rb Makefile`.split
- s.extensions= ["ext/google/protobuf_c/extconf.rb"]
- else
+ s.files = Dir.glob('lib/**/*.rb')
+ if RUBY_PLATFORM == "java"
s.files += ["lib/google/protobuf_java.jar"]
+ else
+ s.files += Dir.glob('ext/**/*')
+ s.extensions= ["ext/google/protobuf_c/extconf.rb"]
+ s.add_development_dependency "rake-compiler-dock"
end
s.test_files = ["tests/basic.rb",
"tests/stress.rb",
diff --git a/ruby/lib/google/protobuf.rb b/ruby/lib/google/protobuf.rb
index f0eb6268..62bdd1bf 100644
--- a/ruby/lib/google/protobuf.rb
+++ b/ruby/lib/google/protobuf.rb
@@ -44,7 +44,11 @@ if RUBY_PLATFORM == "java"
require 'json'
require 'google/protobuf_java'
else
- require 'google/protobuf_c'
+ begin
+ require "google/#{RUBY_VERSION.sub(/\.\d$/, '')}/protobuf_c"
+ rescue LoadError
+ require 'google/protobuf_c'
+ end
end
require 'google/protobuf/repeated_field'
diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h
index 020f20c7..e3771003 100644
--- a/src/google/protobuf/io/coded_stream.h
+++ b/src/google/protobuf/io/coded_stream.h
@@ -117,7 +117,7 @@
#if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
#define PROTOBUF_LITTLE_ENDIAN 1
#endif
- #if _MSC_VER >= 1300
+ #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
// If MSVC has "/RTCc" set, it will complain about truncating casts at
// runtime. This file contains some intentional truncating casts.
#pragma runtime_checks("c", off)
@@ -1286,9 +1286,9 @@ inline bool CodedInputStream::IsFlat() const {
} // namespace protobuf
-#if defined(_MSC_VER) && _MSC_VER >= 1300
+#if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
#pragma runtime_checks("c", restore)
-#endif // _MSC_VER
+#endif // _MSC_VER && !defined(__INTEL_COMPILER)
} // namespace google
#endif // GOOGLE_PROTOBUF_IO_CODED_STREAM_H__
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
index b35a3afe..1036dff1 100644
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -53,7 +53,7 @@
#if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
#define PROTOBUF_LITTLE_ENDIAN 1
#endif
- #if defined(_MSC_VER) && _MSC_VER >= 1300
+ #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
// If MSVC has "/RTCc" set, it will complain about truncating casts at
// runtime. This file contains some intentional truncating casts.
#pragma runtime_checks("c", off)