Commit ab748d5
authored
Define LEXBOR_STATIC in CFLAGS_URI for static ext/uri on Windows (php#22165)
ext/uri is always built statically (false /* never shared */ in
EXTENSION()) and includes the bundled lexbor headers via /I ext/lexbor.
On Windows, lexbor's LXB_API macro defaults to __declspec(dllimport),
which produces LNK2019 unresolved external symbol errors for every
lxb_* function referenced from ext/uri when PHP itself is linked
statically without a runtime DLL.
Adding /D LEXBOR_STATIC to CFLAGS_URI in ext/uri/config.w32 makes
LXB_API expand to nothing for ext/uri's compilation units. The scope
matches URI_STATIC_BUILD on the same line: per-consumer, because
other lexbor consumers (e.g. ext/dom, which can build as shared)
must decide for themselves whether to disable the dllimport
decoration.1 parent c956d6d commit ab748d5
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments