ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<andrewrk>
oats, let me try to build a fix to this problem. what's going on is that currently zig assumes that libc is required if you use @cImport
<andrewrk>
knebulae, I'm looking at your code. what's the problem?
fsateler has quit [Read error: Connection reset by peer]
fsateler has joined #zig
<andrewrk>
mgxm, are Scrt1.o, crti.o crtbegin.o etc not required for freebsd?
emekoi has quit [Ping timeout: 244 seconds]
<knebulae>
andrewrk: error: cannot store runtime value in compile time variable
<knebulae>
andrewrk: regarding message2
<knebulae>
I don't know what else to do to make sure the Ascii2WChar fn runs at compile time.
<knebulae>
andrewrk: I gotcha. I think it's easiest to simply put my strings together from the C side right now where wide string literals are as simple as prefixing an L"blah". Just for now though.
<andrewrk>
knebulae, on the zig side it could be as easy as prefixing L("blah")
<knebulae>
Might be useful for Windows interop.
<andrewrk>
oats, I just pushed a commit that should fix your issue
steveno has joined #zig
<oats>
andrewrk: you're awesome dude, thanks so much :)
<andrewrk>
no problem, let me know if you run into anything else
<oats>
well, I can't assign to the result of a macro expansion
<oats>
but I figured that wouldn't work properly
<andrewrk>
oats, you can probably inspect the macro manually and create a roughly equivalent abstraction using functions
<andrewrk>
for example, it could be a function that returns a pointer, so you would assign by dereferencing the result
<andrewrk>
the fundamental problem here is that, in zig, assignment is assignment. the C macro is trying to violate that, and that's not allowed because we want to be able to look at an assignment and rely on it always being an assignment
<oats>
gotcha
steveno_ has joined #zig
steveno has quit [Ping timeout: 250 seconds]
<mgxm>
andrewrk: I'm not sure
<mgxm>
i'll find out and guarantee this tomorrow
steshaw has quit [Quit: Connection closed for inactivity]
steveno_ has quit [Remote host closed the connection]
<DutchGh0st>
Can you shrink a slice while iterating over it?
<DutchGh0st>
like, won't it read past the current slice's contents?
Zaab1t has joined #zig
<IntoxicatedHippo>
Do you mean something like `for (x) |_| x = x[0..2];`?
<IntoxicatedHippo>
DutchGh0st
<DutchGh0st>
yeah for example
<IntoxicatedHippo>
I haven't checked this at all and the documentation doesn't seem to say anything about it, but I assume the loop would make a copy of the slices data.
<DutchGh0st>
mhh okey...darnish haha
<DutchGh0st>
then I guess I'd have to do clever indexing and swapRemove stuff ^^
<DutchGh0st>
I keep an arraylist of constellations (a constellation is an arraylist of points), and merge the ones together that can merge (manhattendst between a point in 1 constellation is 3 or less than a point in another constellation),
<DutchGh0st>
if 2 can merge, I appendSlice() one constellation to the other, and shrinking the one I took the slice from to a size of 0,
<DutchGh0st>
but then I end up with empty entry's in the constellations arraylist, which .. is okey, but maybe I can just swap remove them with the last entry of the constellations list
IntoxicatedHippo has quit [Ping timeout: 272 seconds]
Zaab1t has joined #zig
belgin has joined #zig
IntoxicatedHippo has joined #zig
<knebulae>
andrewrk: have you noticed anything unusual when calling C functions that have varargs? I'm wrapping the Print() uefi call, and while numbers can be passed in the format string and are inlined properly, strings are not (they actually display as though 2 separate Print() calls were made).