]> granicus.if.org Git - php/commitdiff
fix cross compilation failure due to size_t typecast in define
authorPascal de Bruijn <pmjdebruijn@pcode.nl>
Thu, 30 Jan 2020 12:48:44 +0000 (13:48 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 30 Jan 2020 14:51:54 +0000 (15:51 +0100)
The following commit introduces a cross-compilation failure:

   93c728b77cfb47f5cfdd1863f8982ea59d344205
  "Try to control ZEND_MM_ALIGNED_SIZE type"

br-arm-full/build/php-7.4.2/Zend/zend_alloc.h:30:38:
error: missing binary operator before token "8"
                                              ^
br-arm-full/build/php-7.4.2/ext/opcache/ZendAccelerator.c:1380:7:
note: in expansion of macro ‘ZEND_MM_ALIGNMENT’

Closes GH-5128.

Zend/zend_alloc.h

index c5838f2ac684b526ce79631da7de58b02616a91d..8bb854328dbdd542a4e2e84051ee1cdab458fcdc 100644 (file)
 #include "zend.h"
 
 #ifndef ZEND_MM_ALIGNMENT
-# define ZEND_MM_ALIGNMENT ((size_t) 8)
+# define ZEND_MM_ALIGNMENT Z_UL(8)
 # define ZEND_MM_ALIGNMENT_LOG2 Z_L(3)
 #elif ZEND_MM_ALIGNMENT < 4
 # undef ZEND_MM_ALIGNMENT
 # undef ZEND_MM_ALIGNMENT_LOG2
-# define ZEND_MM_ALIGNMENT ((size_t) 4)
+# define ZEND_MM_ALIGNMENT Z_UL(4)
 # define ZEND_MM_ALIGNMENT_LOG2 Z_L(2)
 #endif