diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 79a6bad86a3365..d67a4c6ec1b183 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -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 instead of for WASM target