Commit abd7152
committed
php#57: Fix C++ compilation error in zend_async_API.h for ICU/intl extension
The flexible array member `data[]` in struct _zend_async_waker_trigger_s
causes MSVC C4200 warning when compiling C++ files (intl_convertcpp.cpp).
C++ doesn't standardize flexible arrays until C++23, treating them as
nonstandard extension.
Changes:
- Add conditional compilation for C++ compatibility in struct definition
- Adjust memory allocation logic to account for different sizeof() behavior
- Preserve optimal C99 flexible array semantics for C compilation
Fixes compilation error when building intl extension with MSVC /WX flag.1 parent 2fad5a3 commit abd7152
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
482 | 488 | | |
483 | 489 | | |
| 490 | + | |
484 | 491 | | |
485 | 492 | | |
486 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
434 | 439 | | |
435 | 440 | | |
436 | 441 | | |
| |||
0 commit comments