diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2016-11-10 11:20:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-10 11:20:50 -0800 |
commit | df8390790aae6025e95687a37eea81a4757966d0 (patch) | |
tree | c2659eb553f560bed02b984050462cba961aaf46 /php/src | |
parent | 9f75c5aa851cd877fb0d93ccc31b8567a6706546 (diff) | |
download | protobuf-df8390790aae6025e95687a37eea81a4757966d0.tar.gz protobuf-df8390790aae6025e95687a37eea81a4757966d0.tar.bz2 protobuf-df8390790aae6025e95687a37eea81a4757966d0.zip |
Fix php c extension on 32-bit machines. (#2348)
Diffstat (limited to 'php/src')
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 10 |
1 files changed, 10 insertions, 0 deletions
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"); + } } } } |