Kaynağa Gözat

Sync latest upb changes

Bo Yang 6 yıl önce
ebeveyn
işleme
cd044e9cbb

+ 2 - 2
php/ext/google/protobuf/def.c

@@ -896,8 +896,8 @@ const upb_filedef *parse_and_add_descriptor(const char *data,
   const upb_filedef* file;
   const upb_filedef* file;
   upb_status status;
   upb_status status;
 
 
-  set = google_protobuf_FileDescriptorSet_parsenew(
-      upb_strview_make(data, data_len), arena);
+  set = google_protobuf_FileDescriptorSet_parse(
+      data, data_len, arena);
 
 
   if (!set) {
   if (!set) {
     zend_error(E_ERROR, "Failed to parse binary descriptor\n");
     zend_error(E_ERROR, "Failed to parse binary descriptor\n");

+ 7 - 0
php/ext/google/protobuf/upb.h

@@ -1,4 +1,11 @@
 /* Amalgamated source file */
 /* Amalgamated source file */
+
+// php.h intentionally defined NDEBUG. We have to define this macro in order to
+// be used together with php.h
+#ifndef NDEBUG
+#define NDEBUG
+#endif
+
 #include <stdint.h>
 #include <stdint.h>
 #ifndef UINTPTR_MAX
 #ifndef UINTPTR_MAX
 #error must include stdint.h first
 #error must include stdint.h first