ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<MajorLag>
is freebsd CI broken or is it just me?
hooo has quit [Quit: Connection closed for inactivity]
<andrewrk>
MajorLag, I think you need to merge master or rebase your PR to fix it
<MajorLag>
alright, not a big deal yet since fixing c_allocator didn't fix whatever is causing the failure in the other CIs, but that one had always passed so I was curious.
Szwagi has joined #zig
<Szwagi>
I'm interested in ziglang, am I in the right place?
<Szwagi>
Right, there's a big header saying it is lol
adrusi_ has joined #zig
adrusi has quit [Ping timeout: 250 seconds]
<wilsonk>
Szwagi: lol, yes you are in the right place. Welcome! :)
Szwagi has quit [Quit: Page closed]
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 244 seconds]
Szwagi has joined #zig
<Szwagi>
Soo.. I'm new to the language, trying to learn via writing some code and reading the documentation. What is the best approach to allocate a singular object on the heap via an allocator?
<Szwagi>
From what I can tell, allocFn returns a []u8 and alloc returns []T. Came up with this -> var window = &(try allocator.alloc(Window, 1))[0];
<Szwagi>
but it seems kinda hacky (?)
<daurnimator>
Szwagi: .createOne
<daurnimator>
(I actually use .create.... but I see that now has a deprecation notice. anyone know why?)
<forgot-password>
Hi guys, I'm having trouble with the c interop again. I have a function that returns an optional pointer to a c struct, which I unwrap via orelse. If, however, I try to access any fields of that struct I get 'type [*]const T does not support field access'. Why is that? Does Zig fail to read the struct structure (no pun intended) in that case?
<daurnimator>
forgot-password: you have an array there. you need to pick a member first
<forgot-password>
Oh my god, how could I be that dense. I even have the c declaration right in front of me. Thank you, daurnimator :)
<forgot-password>
Is there a way to automatically unwrap the first element of my optional pointer or do I *have to* go through a separate variable?
<daurnimator>
forgot-password: huh? shouldn't it just be a case of adding [0] to your one-liner?
<forgot-password>
Right, I can just put it in parens. Maybe I should get something to eat before I continue ^^
kristate has joined #zig
<daurnimator>
forgot-password: or edit the generated zig to change [*] to plain *