Skip to content

Commit

Permalink
libarchive: Define _GNU_SOURCE when checking for types
Browse files Browse the repository at this point in the history
In glibc certain types such as `id_t` are gated behind checks for `__USE_XOPEN` and similar defines that are set set when `_GNU_SOURCE` is defines which is done by libarchive's cmake `config.h.in`. Without this, the types visible to meson during the checks and the compiler during compilation can differ resulting in these types can be defined twice which can cause compilation errors.
  • Loading branch information
PixelyIon authored and neheb committed Sep 15, 2023
1 parent 2db326f commit 1c5a17e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@
"libarchive"
],
"versions": [
"3.7.2-2",
"3.7.2-1",
"3.7.1-2",
"3.7.1-1",
Expand Down
2 changes: 1 addition & 1 deletion subprojects/packagefiles/libarchive/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ types = {
}

foreach t, v : types
if not cc.has_type(t, prefix: '#include <sys/types.h>')
if not cc.has_type(t, prefix: '#include <sys/types.h>', args: '-D_GNU_SOURCE')
cdata.set(t, v)
endif
endforeach
Expand Down

0 comments on commit 1c5a17e

Please sign in to comment.