diff options
Diffstat (limited to 'php/ext/google/protobuf/protobuf.h')
-rw-r--r-- | php/ext/google/protobuf/protobuf.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 20035ab7..3ef4c84b 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -42,6 +42,10 @@ #define MAX_LENGTH_OF_INT64 20 #define SIZEOF_INT64 8 +/* From Chromium. */ +#define ARRAY_SIZE(x) \ + ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) + // ----------------------------------------------------------------------------- // PHP7 Wrappers // ---------------------------------------------------------------------------- |