1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/dl/dl.v
2021-02-23 09:46:28 +02:00

28 lines
578 B
V

module dl
pub const (
version = 1
dl_ext = get_shared_library_extension()
)
// get_shared_library_extension returns the platform dependent shared library extension
// i.e. .dll on windows, .so on most unixes, .dylib on macos.
[inline]
pub fn get_shared_library_extension() string {
mut res := '.so'
$if macos {
res = '.dylib'
}
$if windows {
res = '.dll'
}
return res
}
// get_libname returns a library name with the operating system specific extension for
// shared libraries.
[inline]
pub fn get_libname(libname string) string {
return '$libname$dl.dl_ext'
}