Commit 5bec589
authored
windows: guard static_assert with __STDC_VERSION__ for C99 compatibility (#810)
windows/hidapi_descriptor_reconstruct.h uses static_assert() to
sanity-check the layout of hid_pp_link_collection_node_. static_assert
was added to <assert.h> in C11; building with -std=c99 (e.g.
set(CMAKE_C_STANDARD 99) in a parent project) on mingw/gcc fails at
that line because the identifier is undeclared.
The assertion's preceding comment describes it as a "risk-reduction
measure" rather than a strict requirement, so guard it with
`#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L`.
C11/C17/C23 toolchains still get the compile-time check; older
standards (and MSVC default C mode, where __STDC_VERSION__ is not
typically set that high) skip it and build cleanly.
Closes: #764
Assisted-by: Claude:claude-opus-4.71 parent 78f95a3 commit 5bec589
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
0 commit comments