all: unify const names to snake_case

This commit is contained in:
yuyi 2020-05-22 23:36:09 +08:00 committed by GitHub
parent aef751861d
commit dda875a9c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 543 additions and 540 deletions

View file

@ -3,9 +3,9 @@ module dl
#include <dlfcn.h>
pub const (
RTLD_NOW = C.RTLD_NOW
RTLD_LAZY = C.RTLD_LAZY
DL_EXT = '.so'
rtld_now = C.RTLD_NOW
rtld_lazy = C.RTLD_LAZY
dl_ext = '.so'
)
fn C.dlopen(filename charptr, flags int) voidptr

View file

@ -18,29 +18,29 @@ fn test_dl() {
fn run_test_invalid_lib_linux() {
// ensure a not-existing dl won't be loaded
h := dl.open('not-existing-dynamic-link-library', dl.RTLD_NOW)
h := dl.open('not-existing-dynamic-link-library', dl.rtld_now)
assert h == 0
}
fn run_test_invalid_lib_windows() {
// ensure a not-existing dl won't be loaded
h := dl.open('not-existing-dynamic-link-library', dl.RTLD_NOW)
h := dl.open('not-existing-dynamic-link-library', dl.rtld_now)
assert h == 0
}
fn run_test_valid_lib_windows() {
h := dl.open('shell32', dl.RTLD_NOW)
h := dl.open('shell32', dl.rtld_now)
assert h != 0
}
fn run_test_invalid_sym_windows() {
h := dl.open('shell32', dl.RTLD_NOW)
h := dl.open('shell32', dl.rtld_now)
proc := dl.sym(h, 'CommandLineToArgvW2')
assert proc == 0
}
fn run_test_valid_sym_windows() {
h := dl.open('shell32', dl.RTLD_NOW)
h := dl.open('shell32', dl.rtld_now)
proc := dl.sym(h, 'CommandLineToArgvW')
assert proc != 0
}

View file

@ -1,9 +1,9 @@
module dl
pub const (
RTLD_NOW = 0
RTLD_LAZY = 0
DL_EXT = '.dll'
rtld_now = 0
rtld_lazy = 0
dl_ext = '.dll'
)
fn C.LoadLibrary(libfilename C.LPCWSTR) voidptr