diff options
-rw-r--r-- | cmake/extract_includes.bat.in | 2 | ||||
-rw-r--r-- | java/core/src/main/java/com/google/protobuf/MapFieldLite.java | 2 | ||||
-rw-r--r-- | php/ext/google/protobuf/protobuf.h | 3 | ||||
-rw-r--r-- | php/ext/google/protobuf/storage.c | 24 | ||||
-rw-r--r-- | php/ext/google/protobuf/type_check.c | 139 | ||||
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 10 | ||||
-rwxr-xr-x | php/tests/test.sh | 3 | ||||
-rw-r--r-- | php/tests/test_base.php | 18 | ||||
-rw-r--r-- | src/Makefile.am | 222 | ||||
-rw-r--r-- | src/google/protobuf/stubs/atomicops.h | 6 | ||||
-rw-r--r-- | src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h (renamed from src/google/protobuf/stubs/atomicops_internals_pnacl.h) | 6 | ||||
-rwxr-xr-x | tests.sh | 7 |
12 files changed, 308 insertions, 134 deletions
diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index abd70616..4b572bb6 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -80,10 +80,10 @@ copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_intern copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h include\google\protobuf\stubs\atomicops_internals_arm_gcc.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h include\google\protobuf\stubs\atomicops_internals_arm_qnx.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h +copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h include\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h include\google\protobuf\stubs\atomicops_internals_generic_gcc.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_macosx.h include\google\protobuf\stubs\atomicops_internals_macosx.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h include\google\protobuf\stubs\atomicops_internals_mips_gcc.h -copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_pnacl.h include\google\protobuf\stubs\atomicops_internals_pnacl.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_power.h include\google\protobuf\stubs\atomicops_internals_power.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_ppc_gcc.h include\google\protobuf\stubs\atomicops_internals_ppc_gcc.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_solaris.h include\google\protobuf\stubs\atomicops_internals_solaris.h diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldLite.java b/java/core/src/main/java/com/google/protobuf/MapFieldLite.java index 3c0ad89a..16b3fefe 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldLite.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldLite.java @@ -58,7 +58,7 @@ public final class MapFieldLite<K, V> extends LinkedHashMap<K, V> { } @SuppressWarnings({"rawtypes", "unchecked"}) - private static final MapFieldLite EMPTY_MAP_FIELD = new MapFieldLite(Collections.emptyMap()); + private static final MapFieldLite EMPTY_MAP_FIELD = new MapFieldLite(); static { EMPTY_MAP_FIELD.makeImmutable(); } diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 93027bc1..fb5879dc 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -39,6 +39,9 @@ #define PHP_PROTOBUF_EXTNAME "protobuf" #define PHP_PROTOBUF_VERSION "3.1.0a1" +#define MAX_LENGTH_OF_INT64 20 +#define SIZEOF_INT64 8 + // ----------------------------------------------------------------------------- // Forward Declaration // ---------------------------------------------------------------------------- diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c index e94aa319..1d25a91b 100644 --- a/php/ext/google/protobuf/storage.c +++ b/php/ext/google/protobuf/storage.c @@ -174,11 +174,31 @@ CASE(FLOAT, DOUBLE, float) CASE(DOUBLE, DOUBLE, double) CASE(BOOL, BOOL, int8_t) CASE(INT32, LONG, int32_t) -CASE(INT64, LONG, int64_t) -CASE(UINT64, LONG, uint64_t) CASE(ENUM, LONG, uint32_t) #undef CASE + +#if SIZEOF_LONG == 4 +#define CASE(upb_type, c_type) \ + case UPB_TYPE_##upb_type: { \ + SEPARATE_ZVAL_IF_NOT_REF(cache); \ + char buffer[MAX_LENGTH_OF_INT64]; \ + sprintf(buffer, "%lld", DEREF(memory, c_type)); \ + ZVAL_STRING(*cache, buffer, 1); \ + return; \ + } +#else +#define CASE(upb_type, c_type) \ + case UPB_TYPE_##upb_type: { \ + SEPARATE_ZVAL_IF_NOT_REF(cache); \ + ZVAL_LONG(*cache, DEREF(memory, c_type)); \ + return; \ + } +#endif +CASE(UINT64, uint64_t) +CASE(INT64, int64_t) +#undef CASE + case UPB_TYPE_UINT32: { // Prepend bit-1 for negative numbers, so that uint32 value will be // consistent on both 32-bit and 64-bit architectures. diff --git a/php/ext/google/protobuf/type_check.c b/php/ext/google/protobuf/type_check.c index c215d72e..d12d0025 100644 --- a/php/ext/google/protobuf/type_check.c +++ b/php/ext/google/protobuf/type_check.c @@ -34,6 +34,7 @@ #include "utf8.h" static zend_class_entry* util_type; +static const char int64_min_digits[] = "9223372036854775808"; ZEND_BEGIN_ARG_INFO_EX(arg_check_optional, 0, 0, 1) ZEND_ARG_INFO(1, val) @@ -78,8 +79,128 @@ void util_init(TSRMLS_D) { // Type checking/conversion. // ----------------------------------------------------------------------------- +// This is modified from is_numeric_string in zend_operators.h. The behavior of +// this function is the same as is_numeric_string, except that this takes +// int64_t as input instead of long. +static zend_uchar convert_numeric_string( + const char *str, int length, int64_t *lval, double *dval) { + const char *ptr; + int base = 10, digits = 0, dp_or_e = 0; + double local_dval = 0.0; + zend_uchar type; + + if (length == 0) { + return IS_NULL; + } + + while (*str == ' ' || *str == '\t' || *str == '\n' || + *str == '\r' || *str == '\v' || *str == '\f') { + str++; + length--; + } + ptr = str; + + if (*ptr == '-' || *ptr == '+') { + ptr++; + } + + if (ZEND_IS_DIGIT(*ptr)) { + // Handle hex numbers + // str is used instead of ptr to disallow signs and keep old behavior. + if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) { + base = 16; + ptr += 2; + } + + // Skip any leading 0s. + while (*ptr == '0') { + ptr++; + } + + // Count the number of digits. If a decimal point/exponent is found, + // it's a double. Otherwise, if there's a dval or no need to check for + // a full match, stop when there are too many digits for a int64 */ + for (type = IS_LONG; + !(digits >= MAX_LENGTH_OF_INT64 && dval); + digits++, ptr++) { +check_digits: + if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) { + continue; + } else if (base == 10) { + if (*ptr == '.' && dp_or_e < 1) { + goto process_double; + } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) { + const char *e = ptr + 1; + + if (*e == '-' || *e == '+') { + ptr = e++; + } + if (ZEND_IS_DIGIT(*e)) { + goto process_double; + } + } + } + break; + } + + if (base == 10) { + if (digits >= MAX_LENGTH_OF_INT64) { + dp_or_e = -1; + goto process_double; + } + } else if (!(digits < SIZEOF_INT64 * 2 || + (digits == SIZEOF_INT64 * 2 && ptr[-digits] <= '7'))) { + if (dval) { + local_dval = zend_hex_strtod(str, &ptr); + } + type = IS_DOUBLE; + } + } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) { +process_double: + type = IS_DOUBLE; + + // If there's a dval, do the conversion; else continue checking + // the digits if we need to check for a full match. + if (dval) { + local_dval = zend_strtod(str, &ptr); + } else if (dp_or_e != -1) { + dp_or_e = (*ptr++ == '.') ? 1 : 2; + goto check_digits; + } + } else { + return IS_NULL; + } + if (ptr != str + length) { + zend_error(E_NOTICE, "A non well formed numeric value encountered"); + return 0; + } + + if (type == IS_LONG) { + if (digits == MAX_LENGTH_OF_INT64 - 1) { + int cmp = strcmp(&ptr[-digits], int64_min_digits); + + if (!(cmp < 0 || (cmp == 0 && *str == '-'))) { + if (dval) { + *dval = zend_strtod(str, NULL); + } + + return IS_DOUBLE; + } + } + if (lval) { + *lval = strtoll(str, NULL, base); + } + return IS_LONG; + } else { + if (dval) { + *dval = local_dval; + } + return IS_DOUBLE; + } +} + #define CONVERT_TO_INTEGER(type) \ - static bool convert_long_to_##type(long val, type##_t* type##_value) { \ + static bool convert_int64_to_##type(int64_t val, type##_t* type##_value) { \ *type##_value = (type##_t)val; \ return true; \ } \ @@ -91,15 +212,15 @@ void util_init(TSRMLS_D) { \ static bool convert_string_to_##type(const char* val, int len, \ type##_t* type##_value) { \ - long lval; \ + int64_t lval; \ double dval; \ \ - switch (is_numeric_string(val, len, &lval, &dval, 0)) { \ + switch (convert_numeric_string(val, len, &lval, &dval)) { \ case IS_DOUBLE: { \ return convert_double_to_##type(dval, type##_value); \ } \ case IS_LONG: { \ - return convert_long_to_##type(lval, type##_value); \ + return convert_int64_to_##type(lval, type##_value); \ } \ default: \ zend_error(E_USER_ERROR, \ @@ -111,7 +232,7 @@ void util_init(TSRMLS_D) { bool protobuf_convert_to_##type(zval* from, type##_t* to) { \ switch (Z_TYPE_P(from)) { \ case IS_LONG: { \ - return convert_long_to_##type(Z_LVAL_P(from), to); \ + return convert_int64_to_##type(Z_LVAL_P(from), to); \ } \ case IS_DOUBLE: { \ return convert_double_to_##type(Z_DVAL_P(from), to); \ @@ -137,7 +258,7 @@ CONVERT_TO_INTEGER(uint64); #undef CONVERT_TO_INTEGER #define CONVERT_TO_FLOAT(type) \ - static bool convert_long_to_##type(long val, type* type##_value) { \ + static bool convert_int64_to_##type(int64_t val, type* type##_value) { \ *type##_value = (type)val; \ return true; \ } \ @@ -149,10 +270,10 @@ CONVERT_TO_INTEGER(uint64); \ static bool convert_string_to_##type(const char* val, int len, \ type* type##_value) { \ - long lval; \ + int64_t lval; \ double dval; \ \ - switch (is_numeric_string(val, len, &lval, &dval, 0)) { \ + switch (convert_numeric_string(val, len, &lval, &dval)) { \ case IS_DOUBLE: { \ *type##_value = (type)dval; \ return true; \ @@ -171,7 +292,7 @@ CONVERT_TO_INTEGER(uint64); bool protobuf_convert_to_##type(zval* from, type* to) { \ switch (Z_TYPE_P(from)) { \ case IS_LONG: { \ - return convert_long_to_##type(Z_LVAL_P(from), to); \ + return convert_int64_to_##type(Z_LVAL_P(from), to); \ } \ case IS_DOUBLE: { \ return convert_double_to_##type(Z_DVAL_P(from), to); \ diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 38513e91..3d1f1598 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -125,6 +125,16 @@ class Message $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; $oneof_name = $oneof->getName(); $this->$oneof_name = new OneofField($oneof); + } else if ($field->getLabel() === GPBLabel::OPTIONAL && + PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } } } } diff --git a/php/tests/test.sh b/php/tests/test.sh index 888e93eb..fe3dc7f6 100755 --- a/php/tests/test.sh +++ b/php/tests/test.sh @@ -7,7 +7,8 @@ pushd ../ext/google/protobuf/ make clean set -e -phpize && ./configure --enable-debug CFLAGS='-g -O0' && make +# Add following in configure for debug: --enable-debug CFLAGS='-g -O0' +phpize && ./configure && make popd tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php ) diff --git a/php/tests/test_base.php b/php/tests/test_base.php index 49886050..d461f0f7 100644 --- a/php/tests/test_base.php +++ b/php/tests/test_base.php @@ -75,20 +75,28 @@ class TestBase extends PHPUnit_Framework_TestCase { $this->assertSame(0, $m->getOptionalInt32()); $this->assertSame(0, $m->getOptionalUint32()); - $this->assertSame(0, $m->getOptionalInt64()); - $this->assertSame(0, $m->getOptionalUint64()); $this->assertSame(0, $m->getOptionalSint32()); - $this->assertSame(0, $m->getOptionalSint64()); $this->assertSame(0, $m->getOptionalFixed32()); - $this->assertSame(0, $m->getOptionalFixed64()); $this->assertSame(0, $m->getOptionalSfixed32()); - $this->assertSame(0, $m->getOptionalSfixed64()); $this->assertSame(0.0, $m->getOptionalFloat()); $this->assertSame(0.0, $m->getOptionalDouble()); $this->assertSame(false, $m->getOptionalBool()); $this->assertSame('', $m->getOptionalString()); $this->assertSame('', $m->getOptionalBytes()); $this->assertNull($m->getOptionalMessage()); + if (PHP_INT_SIZE == 4) { + $this->assertSame("0", $m->getOptionalInt64()); + $this->assertSame("0", $m->getOptionalUint64()); + $this->assertSame("0", $m->getOptionalSint64()); + $this->assertSame("0", $m->getOptionalFixed64()); + $this->assertSame("0", $m->getOptionalSfixed64()); + } else { + $this->assertSame(0, $m->getOptionalInt64()); + $this->assertSame(0, $m->getOptionalUint64()); + $this->assertSame(0, $m->getOptionalSint64()); + $this->assertSame(0, $m->getOptionalFixed64()); + $this->assertSame(0, $m->getOptionalSfixed64()); + } } // This test is to avoid the warning of no test by php unit. diff --git a/src/Makefile.am b/src/Makefile.am index faee6d96..8d9e07ab 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,117 +61,117 @@ CLEANFILES = $(protoc_outputs) unittest_proto_middleman \ MAINTAINERCLEANFILES = \ Makefile.in -nobase_include_HEADERS = \ - google/protobuf/stubs/atomic_sequence_num.h \ - google/protobuf/stubs/atomicops.h \ - google/protobuf/stubs/atomicops_internals_power.h \ - google/protobuf/stubs/atomicops_internals_ppc_gcc.h \ - google/protobuf/stubs/atomicops_internals_arm64_gcc.h \ - google/protobuf/stubs/atomicops_internals_arm_gcc.h \ - google/protobuf/stubs/atomicops_internals_arm_qnx.h \ - google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ - google/protobuf/stubs/atomicops_internals_generic_gcc.h \ - google/protobuf/stubs/atomicops_internals_macosx.h \ - google/protobuf/stubs/atomicops_internals_mips_gcc.h \ - google/protobuf/stubs/atomicops_internals_pnacl.h \ - google/protobuf/stubs/atomicops_internals_solaris.h \ - google/protobuf/stubs/atomicops_internals_tsan.h \ - google/protobuf/stubs/atomicops_internals_x86_gcc.h \ - google/protobuf/stubs/atomicops_internals_x86_msvc.h \ - google/protobuf/stubs/callback.h \ - google/protobuf/stubs/bytestream.h \ - google/protobuf/stubs/casts.h \ - google/protobuf/stubs/common.h \ - google/protobuf/stubs/fastmem.h \ - google/protobuf/stubs/hash.h \ - google/protobuf/stubs/logging.h \ - google/protobuf/stubs/macros.h \ - google/protobuf/stubs/mutex.h \ - google/protobuf/stubs/once.h \ - google/protobuf/stubs/platform_macros.h \ - google/protobuf/stubs/port.h \ - google/protobuf/stubs/scoped_ptr.h \ - google/protobuf/stubs/shared_ptr.h \ - google/protobuf/stubs/singleton.h \ - google/protobuf/stubs/status.h \ - google/protobuf/stubs/stl_util.h \ - google/protobuf/stubs/stringpiece.h \ - google/protobuf/stubs/template_util.h \ - google/protobuf/stubs/type_traits.h \ - google/protobuf/any.pb.h \ - google/protobuf/api.pb.h \ - google/protobuf/any.h \ - google/protobuf/arena.h \ - google/protobuf/arenastring.h \ - google/protobuf/descriptor_database.h \ - google/protobuf/descriptor.h \ - google/protobuf/descriptor.pb.h \ - google/protobuf/duration.pb.h \ - google/protobuf/dynamic_message.h \ - google/protobuf/empty.pb.h \ - google/protobuf/extension_set.h \ - google/protobuf/field_mask.pb.h \ - google/protobuf/generated_enum_reflection.h \ - google/protobuf/generated_enum_util.h \ - google/protobuf/generated_message_reflection.h \ - google/protobuf/generated_message_util.h \ - google/protobuf/has_bits.h \ - google/protobuf/map_entry.h \ - google/protobuf/map_entry_lite.h \ - google/protobuf/map_field.h \ - google/protobuf/map_field_inl.h \ - google/protobuf/map_field_lite.h \ - google/protobuf/map.h \ - google/protobuf/map_type_handler.h \ - google/protobuf/message.h \ - google/protobuf/message_lite.h \ - google/protobuf/metadata.h \ - google/protobuf/reflection.h \ - google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/service.h \ - google/protobuf/source_context.pb.h \ - google/protobuf/struct.pb.h \ - google/protobuf/text_format.h \ - google/protobuf/timestamp.pb.h \ - google/protobuf/type.pb.h \ - google/protobuf/unknown_field_set.h \ - google/protobuf/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wire_format_lite_inl.h \ - google/protobuf/wrappers.pb.h \ - google/protobuf/io/coded_stream.h \ - $(GZHEADERS) \ - google/protobuf/io/printer.h \ - google/protobuf/io/strtod.h \ - google/protobuf/io/tokenizer.h \ - google/protobuf/io/zero_copy_stream.h \ - google/protobuf/io/zero_copy_stream_impl.h \ - google/protobuf/io/zero_copy_stream_impl_lite.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/importer.h \ - google/protobuf/compiler/parser.h \ - google/protobuf/compiler/plugin.h \ - google/protobuf/compiler/plugin.pb.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/java/java_generator.h \ - google/protobuf/compiler/java/java_names.h \ - google/protobuf/compiler/javanano/javanano_generator.h \ - google/protobuf/compiler/js/js_generator.h \ - google/protobuf/compiler/objectivec/objectivec_generator.h \ - google/protobuf/compiler/objectivec/objectivec_helpers.h \ - google/protobuf/compiler/php/php_generator.h \ - google/protobuf/compiler/python/python_generator.h \ - google/protobuf/compiler/ruby/ruby_generator.h \ - google/protobuf/util/type_resolver.h \ - google/protobuf/util/field_comparator.h \ - google/protobuf/util/field_mask_util.h \ - google/protobuf/util/json_util.h \ - google/protobuf/util/time_util.h \ - google/protobuf/util/type_resolver_util.h \ +nobase_include_HEADERS = \ + google/protobuf/stubs/atomic_sequence_num.h \ + google/protobuf/stubs/atomicops.h \ + google/protobuf/stubs/atomicops_internals_power.h \ + google/protobuf/stubs/atomicops_internals_ppc_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm64_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm_qnx.h \ + google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ + google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h \ + google/protobuf/stubs/atomicops_internals_generic_gcc.h \ + google/protobuf/stubs/atomicops_internals_macosx.h \ + google/protobuf/stubs/atomicops_internals_mips_gcc.h \ + google/protobuf/stubs/atomicops_internals_solaris.h \ + google/protobuf/stubs/atomicops_internals_tsan.h \ + google/protobuf/stubs/atomicops_internals_x86_gcc.h \ + google/protobuf/stubs/atomicops_internals_x86_msvc.h \ + google/protobuf/stubs/callback.h \ + google/protobuf/stubs/bytestream.h \ + google/protobuf/stubs/casts.h \ + google/protobuf/stubs/common.h \ + google/protobuf/stubs/fastmem.h \ + google/protobuf/stubs/hash.h \ + google/protobuf/stubs/logging.h \ + google/protobuf/stubs/macros.h \ + google/protobuf/stubs/mutex.h \ + google/protobuf/stubs/once.h \ + google/protobuf/stubs/platform_macros.h \ + google/protobuf/stubs/port.h \ + google/protobuf/stubs/scoped_ptr.h \ + google/protobuf/stubs/shared_ptr.h \ + google/protobuf/stubs/singleton.h \ + google/protobuf/stubs/status.h \ + google/protobuf/stubs/stl_util.h \ + google/protobuf/stubs/stringpiece.h \ + google/protobuf/stubs/template_util.h \ + google/protobuf/stubs/type_traits.h \ + google/protobuf/any.pb.h \ + google/protobuf/api.pb.h \ + google/protobuf/any.h \ + google/protobuf/arena.h \ + google/protobuf/arenastring.h \ + google/protobuf/descriptor_database.h \ + google/protobuf/descriptor.h \ + google/protobuf/descriptor.pb.h \ + google/protobuf/duration.pb.h \ + google/protobuf/dynamic_message.h \ + google/protobuf/empty.pb.h \ + google/protobuf/extension_set.h \ + google/protobuf/field_mask.pb.h \ + google/protobuf/generated_enum_reflection.h \ + google/protobuf/generated_enum_util.h \ + google/protobuf/generated_message_reflection.h \ + google/protobuf/generated_message_util.h \ + google/protobuf/has_bits.h \ + google/protobuf/map_entry.h \ + google/protobuf/map_entry_lite.h \ + google/protobuf/map_field.h \ + google/protobuf/map_field_inl.h \ + google/protobuf/map_field_lite.h \ + google/protobuf/map.h \ + google/protobuf/map_type_handler.h \ + google/protobuf/message.h \ + google/protobuf/message_lite.h \ + google/protobuf/metadata.h \ + google/protobuf/reflection.h \ + google/protobuf/reflection_ops.h \ + google/protobuf/repeated_field.h \ + google/protobuf/service.h \ + google/protobuf/source_context.pb.h \ + google/protobuf/struct.pb.h \ + google/protobuf/text_format.h \ + google/protobuf/timestamp.pb.h \ + google/protobuf/type.pb.h \ + google/protobuf/unknown_field_set.h \ + google/protobuf/wire_format.h \ + google/protobuf/wire_format_lite.h \ + google/protobuf/wire_format_lite_inl.h \ + google/protobuf/wrappers.pb.h \ + google/protobuf/io/coded_stream.h \ + $(GZHEADERS) \ + google/protobuf/io/printer.h \ + google/protobuf/io/strtod.h \ + google/protobuf/io/tokenizer.h \ + google/protobuf/io/zero_copy_stream.h \ + google/protobuf/io/zero_copy_stream_impl.h \ + google/protobuf/io/zero_copy_stream_impl_lite.h \ + google/protobuf/compiler/code_generator.h \ + google/protobuf/compiler/command_line_interface.h \ + google/protobuf/compiler/importer.h \ + google/protobuf/compiler/parser.h \ + google/protobuf/compiler/plugin.h \ + google/protobuf/compiler/plugin.pb.h \ + google/protobuf/compiler/cpp/cpp_generator.h \ + google/protobuf/compiler/csharp/csharp_generator.h \ + google/protobuf/compiler/csharp/csharp_names.h \ + google/protobuf/compiler/java/java_generator.h \ + google/protobuf/compiler/java/java_names.h \ + google/protobuf/compiler/javanano/javanano_generator.h \ + google/protobuf/compiler/js/js_generator.h \ + google/protobuf/compiler/objectivec/objectivec_generator.h \ + google/protobuf/compiler/objectivec/objectivec_helpers.h \ + google/protobuf/compiler/php/php_generator.h \ + google/protobuf/compiler/python/python_generator.h \ + google/protobuf/compiler/ruby/ruby_generator.h \ + google/protobuf/util/type_resolver.h \ + google/protobuf/util/field_comparator.h \ + google/protobuf/util/field_mask_util.h \ + google/protobuf/util/json_util.h \ + google/protobuf/util/time_util.h \ + google/protobuf/util/type_resolver_util.h \ google/protobuf/util/message_differencer.h lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index 6a539153..10a71ed4 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -196,7 +196,11 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); // Apple. #elif defined(GOOGLE_PROTOBUF_OS_APPLE) +#if __has_feature(cxx_atomic) || _GNUC_VER >= 407 +#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h> +#else // __has_feature(cxx_atomic) || _GNUC_VER >= 407 #include <google/protobuf/stubs/atomicops_internals_macosx.h> +#endif // __has_feature(cxx_atomic) || _GNUC_VER >= 407 // GCC. #elif defined(__GNUC__) @@ -217,7 +221,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #elif defined(GOOGLE_PROTOBUF_ARCH_POWER) #include <google/protobuf/stubs/atomicops_internals_power.h> #elif defined(__native_client__) -#include <google/protobuf/stubs/atomicops_internals_pnacl.h> +#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h> #elif defined(GOOGLE_PROTOBUF_ARCH_PPC) #include <google/protobuf/stubs/atomicops_internals_ppc_gcc.h> #elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) diff --git a/src/google/protobuf/stubs/atomicops_internals_pnacl.h b/src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h index 3b314fd0..7bc584eb 100644 --- a/src/google/protobuf/stubs/atomicops_internals_pnacl.h +++ b/src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h @@ -30,8 +30,8 @@ // This file is an internal atomic implementation, use atomicops.h instead. -#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ -#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ +#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_ +#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_ #include <atomic> @@ -228,4 +228,4 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) { } // namespace protobuf } // namespace google -#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ +#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_ @@ -393,6 +393,12 @@ build_php5.5_32() { ./vendor/bin/phpunit } +build_php5.5_c_32() { + use_php_bc 5.5 + wget https://phar.phpunit.de/phpunit-old.phar -O /usr/bin/phpunit + cd php/tests && /bin/bash ./test.sh && cd ../.. +} + build_php5.6() { use_php 5.6 rm -rf vendor @@ -449,6 +455,7 @@ build_php_all() { build_php_all_32() { build_php5.5_32 + build_php5.5_c_32 } # Note: travis currently does not support testing more than one language so the |