diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 24055123b1..9d99e57f5b 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -188,7 +188,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { // arguments for the C compiler ccoptions.args = [v.pref.cflags] if !v.pref.no_std { - ccoptions.args << '-std=c99' + ccoptions.args << '-std=c99 -D_DEFAULT_SOURCE' } ccoptions.wargs = [ '-Wall', diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index 467bd64b5e..48980fdb25 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -519,6 +519,8 @@ pub fn find_all_v_files(roots []string) ?[]string { // if you add another cached unsafe function using static, do not forget to add // a mechanism to clear its cache, and call it here. pub fn free_caches() { - unsafe { cached_read_source_file('') or {} } - unsafe { cached_file2sourcelines('') } + unsafe { + cached_file2sourcelines('') + cached_read_source_file('') or { '' } + } }