Skip to content

Commit

Permalink
cgen: define _GNU_SOURCE on Linux
Browse files Browse the repository at this point in the history
For gettid() declaration (and other GNU-specific bits).
  • Loading branch information
davidebeatrici committed Jan 4, 2025
1 parent 3ed799e commit 4a714e1
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 4a714e1

Please sign in to comment.