toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

234
active users

#endif

0 posts0 participants0 posts today
witch_t *navi<p>one key takeway i had from this <code>soname / abi != package-version / api</code> is that adding fields to structures shouldn’t be a thing to worry about that much, removing them yes, adding, reordering, etc, no</p><p>libraries shouldn’t keep their data “obscured” behind a malloc-d pointer <em>just</em> for the sake of binary compatibility. there is other reasons for opaque pointers, but more often than not, a library will be better by letting users choose where to allocate data, be it on the stack or on the heap or statically or so on</p><p>and if you worry about people accessing fields they shouldn’t, c23 provides <code>[[deprecated]]</code>, meaning you can do:</p><pre><code>#if !defined(MYLIB_INTERNAL) &amp;&amp; __STDC_VERSION__ &gt;= 202311L # define mylib_private [[deprecated("private struct member, do not use.")]] <a class="hashtag" href="https://social.vlhl.dev/tag/else" rel="nofollow noopener" target="_blank">#else</a> # define mylib_private <a class="hashtag" href="https://social.vlhl.dev/tag/endif" rel="nofollow noopener" target="_blank">#endif</a> </code></pre><p>and mark struct members as such</p> <p>distros should have mechanism to easily trigger rebuilds on soname changes, as well as mechanisms to keep the old soname around as long as there’s packages linked to it</p><p>the fact that some distros don’t, is not a limitation of the system, but an implementation failure</p>
Foone🏳️‍⚧️<p><a href="https://digipres.club/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> SUPPORT_GAME_TETRIS<br> TerisPolling(diff);<br> <a href="https://digipres.club/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a> </p><p>TERIS? FUCKING TERIS?</p>
Siguza<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@ranvel" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ranvel</span></a></span> to be more specific, for a given folder <code>PREFIX</code>, this is my ncurses config:</p><p><code>./configure --prefix="$PREFIX" --enable-widec</code></p><p>and this is my nano config:</p><p><code>./configure --prefix="$PREFIX" --disable-nls --enable-utf8 --enable-year2038 NCURSESW_CFLAGS="-I$PREFIX/include" NCURSESW_LIBS="-L$PREFIX/lib -lncursesw"</code></p><p>With ncurses 6.5 and nano 8.5, that leads to a bunch of linker failures for imports with "$NCURSES60" suffix... which comes from Apple's SDK. And if you look at nano src, you can find this:</p><pre><code>/* Prefer wide ncurses over normal ncurses over curses. */<br>#if defined(HAVE_NCURSESW_NCURSES_H)<br>#include &lt;ncursesw/ncurses.h&gt;<br>#elif defined(HAVE_NCURSES_H)<br>#include &lt;ncurses.h&gt;<br>#else<br>#include &lt;curses.h&gt;<br>#endif<br></code></pre><p>So unless you define <code>HAVE_NCURSESW_NCURSES_H</code>, it will include the wrong header. And while <code>HAVE_NCURSES_H</code> shows up in <code>configure</code>, <code>HAVE_NCURSESW_NCURSES_H</code> does not...</p>
jesse squires<p>Nice improvement in Xcode 26.</p><p>Show's the <a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> that matches the <a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p>
wirepair<p>fucking hell winspool.h:</p><p><a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> UNICODE<br><a href="https://mastodon.social/tags/define" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>define</span></a> AddJob AddJobW<br><a href="https://mastodon.social/tags/else" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>else</span></a><br><a href="https://mastodon.social/tags/define" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>define</span></a> AddJob AddJobA<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a> // !UNICODE</p><p>Jolt defines a class method called...<br>virtual void AddJob(const JobHandle &amp;inJob) override;</p><p>guess some ordering got re-arranged and now my shit is conflicting</p>
Thierry Laurion<p><span class="h-card" translate="no"><a href="https://mas.to/@libreleah" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>libreleah</span></a></span> <span class="h-card" translate="no"><a href="https://mas.to/@mkukri" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>mkukri</span></a></span> </p><p>Both Heads and lbmk permit to apply patches on top of a coreboot fork. </p><p>The difference between the two here is that lbmk builds the tree, clean, for each boards, where Heads applies the patches to a fork once, and each board reuses fork build artifacts;, building board specifics in a board specific artifact directory. That permits crossgcc, being the buildstack of each coreboot fork version to be built once, and also repro build issues upstream, economizing both disk space, cpu resource for user and CI.</p><p>In Heads goal of building fully functional roms, CI can build and stitch reproducible roms for each commit for end users to download directly from CI, for each commit, and see if a comit broke a built, for each commit. CI cache is reused, so that we don't waste CI resources either.</p><p>In the case of t480, the patch was made with lbmk in mind, not coreboot nor Heads, and breaks other thinkpads in coreboot upstream, trying to not only build for t480 but make sure t480 patchset doesn't break other boards. In this case, it breaks all other thinkpads, so prevent Heads from merging the PR. What you propose here is for libreboot and Heads to maintain a patchset not merged upstream; it might suit libreboot mindset, being more bleeding edge, and minifree, selling the t480, but not Heads. Heads tries to stay as close as possible to upstream forks, and pushes upstream projects to merge patches. Its long, not easy, but the right thing to do. The patches stays in a patch dir for everyone to see, per software version. In this case, patches/coreboot-24.12/*</p><p>I tried to apply the following patch without success instead of commenting thermal.asl</p><p>+diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl<br>+index bc54d3b..a0408c8 100644<br>+--- a/src/ec/lenovo/h8/acpi/ec.asl<br>++++ b/src/ec/lenovo/h8/acpi/ec.asl<br>+@@ -331,7 +331,13 @@ Device(EC)<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "sleepbutton.asl"<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "lid.asl"<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "beep.asl"<br>++<br>++<a href="https://infosec.exchange/tags/ifndef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifndef</span></a> CONFIG_BOARD_LENOVO_T480<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "thermal.asl"<br>++<a href="https://infosec.exchange/tags/else" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>else</span></a><br>++//#include "thermal.asl"<br>++<a href="https://infosec.exchange/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a><br>++<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "systemstatus.asl"<br>+ <a href="https://infosec.exchange/tags/include" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>include</span></a> "thinkpad.asl"<br>+ }</p><p>Other non t480 fail to build, and I have no more time to spend on this. The community is interested, tried to reach libreboot and were seen as spammers.</p><p>Please fix your patchset upstream. People saw the t480 being "supported by coreboot" in a talk. People didn't understand it was a WiP patchset under coreboot. And here we are. 24.12 was december 2024 "release", there will be another one in 25.03... I do not have time to maintain patches on top of patches, Leah. My focus is not to be a coreboot distribution. My focus is to deliver reproducible roms to users needing accessible security, and improve that UX. There is no grub/seabios under Heads, my focus is to make upstream do the right thing and participate upstream, and make contributors participate upstream. Here, you stated loud and clear tha libreboot comes first before coreboot, I respect that. But the t480 patchset is the one too from upstream. That upstream patch needs to build, and then will be merged and then you won't have to maintain it either. And others will fix audio issues, nvidia etc. Otherwise its silo work, and i'm not interested in that anymore</p><p>---</p><p>Yes, there is different coreboot forks specified in a central place: modules/coreboot. </p><p>And there, the buildsystem says if it can reuse crossgcc of another fork to fasten builds for each commit. The idea here is that the user building one board, or multiple boards will get the same result, but CI building multiple boards based on the same fork will speed up builds massively.</p><p>d16 will move to fam15h fork from other community effort. I mentor now, I don't try to do everything myself. Just as here, trying tto collaborate with you so you fix what was brought up upstream. But up to now, you are upstream for t480.</p><p>The goal here was not to compare our buildsystems, simply stating that the patchset upstream will never be merged if it causes regressions building other boards. Libreboot can do what it wants, but needs to respect how coreboot works. Their CI does the same, and make sure that building a commit for a board won't break others. In current case, it breaks others and needs to be updated.</p><p>This needs to be fixed upstream at <a href="https://review.coreboot.org/c/coreboot/+/83274" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">review.coreboot.org/c/coreboot</span><span class="invisible">/+/83274</span></a></p>
Craig Hockenberry<p>Good news: there's code for it:</p><p><a href="https://mastodon.social/tags/ifndef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifndef</span></a> ZAHL<br><a href="https://mastodon.social/tags/define" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>define</span></a> ZAHL 0<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>Bad news: XOR-ing a value with 0 isn't going to help. It's a NOP.</p><p>And it's intentional, for example:</p><p>ts ^= ZAHL; /* hehe */</p><p>I can’t reverse engineer the real value of ZAHL without knowing the original timestamp.</p><p>It might be possible to do an exhaustive search, but time_t is a long long and my time is short short.</p><p>So no blog.fefe.de for Tapestry. Sorry!</p><p>3/3</p>
robrich<p><a href="https://khalidabuhakmeh.com/unit-tests-for-legacy-systems-with-dotnet-6" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">khalidabuhakmeh.com/unit-tests</span><span class="invisible">-for-legacy-systems-with-dotnet-6</span></a> - in <a href="https://hachyderm.io/tags/dotNET" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotNET</span></a>, use a compiler directive to <a href="https://hachyderm.io/tags/mock" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mock</span></a> <a href="https://hachyderm.io/tags/static" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>static</span></a> classes:<br>```<br><a href="https://hachyderm.io/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> MOCK_TIME<br>global using DateTimeOffset = StubDateTimeOffset; <br><a href="https://hachyderm.io/tags/else" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>else</span></a><br>global using DateTimeOffset = System.DateTimeOffset;<br><a href="https://hachyderm.io/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a> <br>```<br>Sweet technique <span class="h-card" translate="no"><a href="https://mastodon.social/@khalidabuhakmeh" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>khalidabuhakmeh</span></a></span>.</p>
Clifton Royston<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>mcc</span></a></span> </p><p>For example, I might have some conditional code defined as </p><p><a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> DEBUG &amp;&amp; PERFORMANCE_CHECK<br>....<br><a href="https://wandering.shop/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>I need to temporarily test it optimized, in the release target, but I don't want to forget what the original condition was. No problem - I quickly switch it to</p><p><a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> true || ( DEBUG &amp;&amp; PERFORMANCE_CHECK)<br>....</p><p>etc.</p>
lambdageek<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>mcc</span></a></span> </p><p><a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> false<br>Console.WriteLine("Hello false");<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a><br><a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> true<br>Console.WriteLine("Hello true");<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>printed hello true.</p><p>adding a DefineConstants for false<br>1. wasn't an error 😠 <br>2. still only printed "hello true"</p>
mcc<p>I am in C#. I wish to create an <a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a>…<a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a> block that will always be false. I say "<a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> false". This will:</p><p>- Erase the code because "false" is not a defined symbol<br>- Keep the code because "false" is a keyword<br>- Keep or not keep depending on whether a command to define false was sent to the c# compiler</p><p>?</p><p>Here's some documentation. It doesn't help with this question</p><p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#conditional-compilation" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">learn.microsoft.com/en-us/dotn</span><span class="invisible">et/csharp/language-reference/preprocessor-directives#conditional-compilation</span></a></p>
Martin Uecker<p><span class="h-card" translate="no"><a href="https://pony.social/@thephd" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>thephd</span></a></span> <span class="h-card" translate="no"><a href="https://mathstodon.xyz/@dougmerritt" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>dougmerritt</span></a></span> I think the concerns of making NULL not be 0 are exaggerated. The POSIX world would not be affected in the first place. And there is always the option for a vendor to offer some backwards compatibility option, which would be as simple as<br> <a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> OLD_CRAP<br> <a href="https://mastodon.social/tags/define" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>define</span></a> NULL 0<br> <a href="https://mastodon.social/tags/else" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>else</span></a><br> <a href="https://mastodon.social/tags/define" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>define</span></a> NULL (void*)0<br> <a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a><br> for those who really do not wish to fix their bugs in their legacy old code.</p>
Jeffy 🏳️‍⚧️🏳️‍🌈🇺🇦 ❤️🇱🇺<p>Avengers: <a href="https://sfba.social/tags/ENDIF" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ENDIF</span></a></p><p><a href="https://sfba.social/tags/TechAMovie" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TechAMovie</span></a><br><a href="https://sfba.social/tags/HashTagGames" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HashTagGames</span></a></p>
witch_t *navi<pre><code>#ifdef ENABLE_TRADITIONAL_ACTIVATION /* Kill the spawned process, since it sucks * (not sure this is what we want to do, but * may as well try it for now) */ if (pending_activation-&gt;babysitter) _dbus_babysitter_kill_child (pending_activation-&gt;babysitter); <a class="hashtag" href="https://social.vlhl.dev/tag/endif" rel="nofollow noopener" target="_blank">#endif</a> </code></pre><p>why is this so funny to me</p>
DrYak<p><span class="h-card" translate="no"><a href="https://bitbang.social/@profoundlynerdy" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>profoundlynerdy</span></a></span> and sometimes stuff like:</p><p>```</p><p><a href="https://mstdn.science/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> 0<br>// ...comment explaining why this block of code is deactivated </p><p><a href="https://mstdn.science/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a><br>```</p>
Robert Widmann<p><span class="h-card" translate="no"><a href="https://soc.mod-12.com/@griotspeak" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>griotspeak</span></a></span> you can put the tests in the same file as the types they’re testing you know!</p><p>struct Foo { private var bar: Bar }</p><p><a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> ENABLE_LITERATE_TESTING<br>internal import Testing</p><p>extension Foo {<br> @Suite(“Foo Tests”)<br> fileprivate struct Tests {<br> <span class="h-card" translate="no"><a href="https://mastodon.social/@Test" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>Test</span></a></span><br> func baz() {<br> <a href="https://mastodon.social/tags/expect" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>expect</span></a>(Foo().bar.isBazzy)<br> }<br> }<br>}<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>anything but @\testable!</p>
Thiago Adams<p>I don't like thinking of the preprocessor as separate from the C language. I can't find many examples where the two are closely related.</p><p>One sample.</p><p><a href="https://social.vivaldi.net/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> u8'~' == '~'<br><a href="https://social.vivaldi.net/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>preprocessor follows the rules of C language u8'' char literals.</p>
Sven A. Schmidt<p><span class="h-card" translate="no"><a href="https://mastodon.social/@simonbs" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>simonbs</span></a></span> How about</p><p>```<br><a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> DEBUG<br> let config = "debug"<br><a href="https://mastodon.social/tags/else" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>else</span></a><br> let config = "release"<br><a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a><br>```</p>
Fluor<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>mcc</span></a></span> true but really it was nothing more than</p><p><a href="https://wetdry.world/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> vsh<br>[vsh code]<br><a href="https://wetdry.world/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p><a href="https://wetdry.world/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> fsh<br>[fsh code]<br><a href="https://wetdry.world/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p>so really nothing crazy here, it just allows you to have everything in one file instead of having to jump between 2 (though now that you point it out, not having the ability to set breakpoints is kind of an issue here)</p>
Rob Napier<p>struct X {<br> var y: Int</p><p> func f() {<br> <a href="https://mastodon.social/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> os(watchOS)<br> let y = self.y + 1<br> <a href="https://mastodon.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p><p> // This seems to work, but is it really valid,<br> // referencing `self.y` on all platforms but Watch?<br> print(y)<br> }<br>}</p><p>The reason I ask is that it feels like it's violating Swift's rules about #.if by changing the meaning of the later `y` token. But maybe that's fine as long as both versions compile?</p>