Open cmb69 opened 4 years ago
Since I've just stumbled upon this issue again, I've tried with the new VS preprocessor, and got C5101:
use of preprocessor directive in function-like macro argument list is undefined behavior
Note that makes it impossible to build this extension with VS (and maybe other compiler tool chains) as of PHP 7.4.0 cmark 1.2.0.
I can buil for PHP 8 and VS16 with a patch from #24 and some other change to fix the build. But some change break the build for PHP 7.4.
The DLL: https://phpext.phptools.online/extension/text/cmark-360
Syntax like https://github.com/krakjoe/cmark/blob/c71ebe2e388239c9cc0fb95d06330fc10535d125/src/block.c#L89-L95 isn't supported by Visual Studio compilers (and maybe others as well). The problem is that the
php_cmark_assert_type
macro gets resolved before the conditional compilation, and is expanded on a single line, yielding invalid syntax.Maybe it's best to rewrite this as: