From 6ac109a7c3e8d972bbb1a15f597f5d86b64d8254 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 16 Nov 2021 19:31:42 +0200 Subject: [PATCH] builtin: add a `[has_globals]` tag for all the .v files, with global declarations in them --- vlib/builtin/builtin.c.v | 1 + vlib/builtin/builtin.v | 1 + vlib/builtin/builtin_windows.c.v | 5 ++--- vlib/builtin/prealloc.c.v | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vlib/builtin/builtin.c.v b/vlib/builtin/builtin.c.v index 39ea002ea6..780b627fe2 100644 --- a/vlib/builtin/builtin.c.v +++ b/vlib/builtin/builtin.c.v @@ -1,3 +1,4 @@ +[has_globals] module builtin type FnExitCb = fn () diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 7e2cfb843a..5194ff9ece 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -1,6 +1,7 @@ // Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved. // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. +[has_globals] module builtin // isnil returns true if an object is nil (only for C objects). diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 97592cff0c..87fdd96006 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -1,6 +1,7 @@ // Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved. // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. +[has_globals] module builtin // dbghelp.h is already included in cheaders.v @@ -66,9 +67,7 @@ const ( ) // g_original_codepage - used to restore the original windows console code page when exiting -__global ( - g_original_codepage = u32(0) -) +__global g_original_codepage = u32(0) // utf8 to stdout needs C.SetConsoleOutputCP(C.CP_UTF8) fn C.GetConsoleOutputCP() u32 diff --git a/vlib/builtin/prealloc.c.v b/vlib/builtin/prealloc.c.v index 0ef66fc650..616949fdd2 100644 --- a/vlib/builtin/prealloc.c.v +++ b/vlib/builtin/prealloc.c.v @@ -1,3 +1,4 @@ +[has_globals] module builtin // With -prealloc, V calls libc's malloc to get chunks, each at least 16MB