Group attributes #2636
ryuukk
started this conversation in
Ideas/Requests
Replies: 1 comment
-
Do this: @(default_calling_convention = "c", private)
foreign _ {
sprintf :: proc "c" (buffer_: ^u8, format_: cstring, #c_vararg args: ..any) -> i32 ---
popen :: proc(command: cstring, type: cstring) -> ^libc.FILE ---
backtrace :: proc(buffer: ^uintptr, size: i32) -> i32 ---
backtrace_symbols :: proc(buffer: ^uintptr, size: i32) -> [^]cstring ---
backtrace_symbols_fd :: proc(buffer: ^uintptr, size: i32, fd: i32) ---
readlink :: proc(pathname: cstring, buf: ^u8, bufsiz: uint) -> int ---
dladdr1 :: proc(__address: uintptr, __info: ^Dl_info, __extra_info: ^rawptr, __flags: i32) -> i32 ---
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote some native definitions that were missing:
I put it at the bottom of the module that uses it, and i'd like to make all that that private without making each symbol ugly with a repeated
@(private)
everywhere, same for "contextlessI could put that on a separate file, but that seems unnecessary
D allows you to do things like:
By using
:
It makes managing your stuff easier and cleaner
I would love to be able to do that with Odin, for private, contextless, similar to how it's done for
foreign
perhaps?Beta Was this translation helpful? Give feedback.
All reactions