1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: remove intermediate handling for both global definition syntaxes (#6546)

This commit is contained in:
Henrixounez
2020-10-03 15:41:45 +02:00
committed by GitHub
parent 7e13518cc2
commit c324169af0
6 changed files with 16 additions and 37 deletions

View File

@ -3,8 +3,10 @@
// that can be found in the LICENSE file.
module builtin
__global g_m2_buf byteptr
__global g_m2_ptr byteptr
__global (
g_m2_buf byteptr
g_m2_ptr byteptr
)
type FnExitCb = fn()
fn C.atexit(f FnExitCb) int
@ -125,10 +127,10 @@ pub fn println(s string) {
}
}
__global total_m i64=0
__global nr_mallocs int=0
fn looo(){} // TODO remove, [ pratt
__global (
total_m = i64(0)
nr_mallocs = int(0)
)
[unsafe]
pub fn malloc(n int) byteptr {

View File

@ -60,7 +60,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
fn C.SetConsoleOutputCP(wCodePageID u32) bool

View File

@ -1070,7 +1070,7 @@ pub fn (s string) ustring() ustring {
// A hack that allows to create ustring without allocations.
// It's called from functions like draw_text() where we know that the string is going to be freed
// right away. Uses global buffer for storing runes []int array.
__global g_ustring_runes []int
__global ( g_ustring_runes []int )
pub fn (s string) ustring_tmp() ustring {
if g_ustring_runes.len == 0 {