mirror of
https://github.com/vlang/v.git
synced 2025-09-08 06:41:58 -04:00
This commit is contained in:
parent
8aef3c72b4
commit
c17c0e16c4
@ -6,6 +6,12 @@ pub type FnExitCb = fn ()
|
||||
fn C.atexit(f FnExitCb) int
|
||||
fn C.strerror(int) &char
|
||||
|
||||
// These functions (_vinit, and _vcleanup), are generated by V, and if you have a `module no_main` program,
|
||||
// you should ensure to call them when appropriate.
|
||||
fn C._vinit(argc int, argv &&char)
|
||||
|
||||
fn C._vcleanup()
|
||||
|
||||
@[markused]
|
||||
fn v_segmentation_fault_handler(signal_number i32) {
|
||||
$if freestanding {
|
||||
|
@ -7,6 +7,8 @@ module builtin
|
||||
// g_original_codepage - used to restore the original windows console code page when exiting
|
||||
__global g_original_codepage = u32(0)
|
||||
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types
|
||||
// See https://www.codeproject.com/KB/string/cppstringguide1.aspx
|
||||
pub type C.BOOL = int
|
||||
|
||||
pub type C.HINSTANCE = voidptr
|
||||
@ -25,6 +27,20 @@ pub type C.HANDLE = voidptr
|
||||
|
||||
pub type C.LRESULT = voidptr
|
||||
|
||||
pub type C.CHAR = char
|
||||
|
||||
pub type C.TCHAR = u16 // It is u8 if UNICODE is not defined, but for V programs it always is
|
||||
|
||||
pub type C.WCHAR = u16
|
||||
|
||||
pub type C.LPSTR = &char
|
||||
|
||||
pub type C.LPWSTR = &C.WCHAR
|
||||
|
||||
pub type C.LPTSTR = &C.TCHAR
|
||||
|
||||
pub type C.LPCTSTR = &C.TCHAR
|
||||
|
||||
// utf8 to stdout needs C.SetConsoleOutputCP(cp_utf8)
|
||||
fn C.GetConsoleOutputCP() u32
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
module test
|
||||
|
||||
fn C._vinit(int, voidptr)
|
||||
fn C.GC_INIT()
|
||||
|
||||
const foo = 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user