Skip to content

Commit

Permalink
cgen: define _GNU_SOURCE on Linux (#23364)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebeatrici authored Jan 4, 2025
1 parent 0763ae7 commit e5ad9a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,10 @@ pub fn (mut g Gen) init() {
#endif
')
}
if g.pref.os == .linux {
// For gettid() declaration (and other GNU-specific bits).
g.cheaders.writeln('#define _GNU_SOURCE')
}
if g.pref.os == .wasm32 {
g.cheaders.writeln('#define VWASM 1')
// Include <stdint.h> instead of <inttypes.h> for WASM target
Expand Down

0 comments on commit e5ad9a6

Please sign in to comment.