Re: Unknown SIZEOF_SIZE_T when compiling extension against PHP 8.0.2
| From: | composer at colannino dot dev | Date: | Tue, 09 Feb 2021 21:33:58 +0000 |
| Subject: | Re: Unknown SIZEOF_SIZE_T when compiling extension against PHP 8.0.2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-113128@lists.php.net to get a copy of this message | ||
On 2/9/21 12:59 PM, composer@colannino.dev wrote:
Recently, I've tried compiling a custom extension against PHP 8.0.2 and have received the following error: In file included from /home/james/git/trogdor-pp/src/php7/trogdord/game.cpp:1: /home/james/local/php8.0.2/include/php/Zend/zend_long.h:124:3: error: #error "Unknown SIZEOF_SIZE_T" 124 | # error "Unknown SIZEOF_SIZE_T"It looks like I can resolve this by doing: extern "C" {| ^~~~~I've not encountered this before and I'm not sure what's changed about my environment other than I upgraded from 8.0.1 to 8.0.2. Does anyone know why this is happening? I dug into the header to see what the problem was, and it's related to the definition of SIZEOF_SIZE_T, but I'm not able to debug any further. Any help would be appreciated. Thank you!
#include "php.h" #include "php_config.h"} Instead of just: extern "C" {
#include "php.h"} I'm not sure what changed (the old way still works for me when I compile against 7.3 and 7.4, and it was working previously for me as recently as 8.0.1), but the extra include fixes the problem for me, so I'm considering this solved. Thanks, everyone!