lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

55
active users

#ifdef

0 posts0 participants0 posts today
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>
Mark T. Tomczak<p>(Possibly relevant to <span class="h-card" translate="no"><a href="https://social.jvns.ca/@b0rk" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>b0rk</span></a></span> 's interests)</p><p>So I hit a flag in diff, <code>--unchanged-group-format</code>. It does not show up in the manpage. It does not show up in --help. You can search both those channels for that string and you will not find it.</p><p>You know where it shows up first? If you Google it, you'll get an example in <a href="https://www.gnu.org/software/diffutils/manual/html_node/Line-Group-Formats.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">gnu.org/software/diffutils/man</span><span class="invisible">ual/html_node/Line-Group-Formats.html</span></a>.</p><p>So why doesn't it show up in the manpage? Well, it does! If you read the entire manpage. With your eyes.</p><pre><code> -D, --ifdef=NAME output merged file with '#ifdef NAME' diffs <br> --GTYPE-group-format=GFMT format GTYPE input groups with GFMT <br> --line-format=LFMT format all input lines with LFMT <br> --LTYPE-line-format=LFMT format LTYPE input lines with LFMT <br> These format options provide fine-grained control over the output <br> of diff, generalizing -D/--ifdef. <br> LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'. <br></code></pre><p>"What do you mean it isn't documented? Of course it's documented. You did read every line and do some template-substitution in your brain, didn't you?"</p><p>This isn't advocating for <em>not</em> reading the manpage. If you really want to understand how the tool works, you read the whole manpage. And probably the source code. 😉 </p><p>... but I <em>don't</em> want to understand how the tool works. I want to diff two files and not have the lines that are the same get emitted.</p><p>And I think a lot of application- and solution-generating computer people, most of the time, in most of their careers, are operating on that level of depth. Problems come in too fast and with too much variety. You <em>absolutely</em> go deep on some things. There is <em>no time</em> to go deep on everything.</p><p>So how do we address this (other than throw up our hands and say "Relying on Google's fuzzy search of the whole Internet and vibe-coding LLMs is the future actually")? I don't have magic bullets, but a "fuzzy search" mode in something like <code>less</code> that could take an input like <code>--unchanged-group-format</code> and twig that it if there's no exact match, it <em>might</em> be related to <code>--GTYPE-group-format</code> would be nice.</p><p>Maybe I should mock that up in emacs. Actually, I bet someone already put it in emacs. ;)</p><p><a href="https://mastodon.fixermark.com/tags/emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>emacs</span></a> <a href="https://mastodon.fixermark.com/tags/manpage" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>manpage</span></a> <a href="https://mastodon.fixermark.com/tags/less" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>less</span></a></p>
Foone🏳️‍⚧️<p>I would say it's the result of a badly written debug macro, ie there's a function that only prints <a href="https://digipres.club/tags/IFDEF" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IFDEF</span></a> DEBUG, instead of a function that's only called if DEBUG is defined. </p><p>except it takes no parameters, so that'd only work if it's a debug function that examples globals and prints about them.</p><p>which is possible, this program is global-heavy</p>
arclight<p><span class="h-card" translate="no"><a href="https://social.wxcafe.net/@Petra" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>Petra</span></a></span> <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> If you're up for reading git history, a few years ago I methodically modernized a F66 text adventure to F2018. <a href="https://gitlab.com/apthorpe/Castlequest" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">gitlab.com/apthorpe/Castleques</span><span class="invisible">t</span></a></p><p>Refactoring away 750+ GOTO statements in the main game loop was satisfying but the last 10 or so took some pretty severe architectural modification. This code is probably a worst case scenario for untangling IF/GOTO logic.</p><p>The binary save file format from 1979 should still work and the game should play about identically to the original, though it accepts both upper and lower case commands now and the output defaults to plain text without the ASA carriage control characters. Builds on Mac, Windows, and Linux with identical source code (no <a href="https://oldbytes.space/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> nonsense) and will create native installers for each platform if the appropriate packaging utilities are installed.</p>
Andrew Plotkin<p><span class="h-card" translate="no"><a href="https://chaos.social/@uliwitness" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>uliwitness</span></a></span> The funny thing is that the last release (1998) has both K&amp;R and ANSI declarations for every single function, separated by "<a href="https://mastodon.gamedev.place/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> __STDC__". But it *still* doesn't bother to declare all its functions in header files, so there are compile errors.</p>
Stefan Eissing<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@jenniferplusplus" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>jenniferplusplus</span></a></span> Apply many small fixes/features, none justifying a refactor, and you‘ll end up with spaghetti if/else or <a href="https://chaos.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> monster code.</p><p>As the cost of refactoring grows geometrically, the point is reached quickly where the budget is beyond what the company is able to do - even if it wanted to.</p><p>Then, there is only bad currency, as you call it, since more spaghetti is the only possible way to work.</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>I assume by "erase" you mean "suppress compile". </p><p>If so then yes, "<a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> false" works perfectly well for what you want.</p><p>C# "<a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a>" is really a hybrid of C "<a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a>" and "<a href="https://wandering.shop/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a>". Any defined symbol evaluates to boolean true, regardless of what it's defined to, and you can do boolean math on them, e.g.<br><a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> A || B</p><p>I use variations on "<a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> false" and "<a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> true" a lot when I'm debugging code I want to be conditionally compiled under some circumstances/targets.</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>
Richard Hendricks<p><span class="h-card" translate="no"><a href="https://mastodon.cloud/@jasongorman" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>jasongorman</span></a></span> me, staring at 500 lines of <a href="https://astronomy.city/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> spaghetti for 1 function....</p><p>:blob_cat_ohnoes:</p>
Sean Eric Fagan<p>Xcode environment question: There are a bunch of places where I need to use the main bundle ID (eg., com.kithrup.SimpleTPP) -- both in code, and in various plists (eg, for NEMachServiceName). Is there a way to use this as a variable? eg. $(whatever) in build settings, and <a href="https://wandering.shop/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> whatever in C-derive code, and <a href="https://wandering.shop/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> whatever in Swift?</p>
Cassandrich<p><span class="h-card" translate="no"><a href="https://social.treehouse.systems/@ariadne" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ariadne</span></a></span> <span class="h-card" translate="no"><a href="https://social.treehouse.systems/@ska" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ska</span></a></span> I mean we've made huge progress on getting ppl not to write code that just assumes GNU/Linux or that's <a href="https://hachyderm.io/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> hell for N supported platforms and fuck anyone running something else.</p>
jacquelines 🌟<p><a href="https://chaos.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> __cplusplus<br>extern "C" {<br><a href="https://chaos.social/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a></p>
Giles GoatNERD stuff, language.
Foone🏳️‍⚧️<p>you can just smell the <a href="https://digipres.club/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a></p>
Travis Gockel<p>Everyone is okay with `<a href="https://hachyderm.io/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> MACRO`, but nobody likes `<a href="https://hachyderm.io/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> defined MACRO`, they all want `<a href="https://hachyderm.io/tags/if" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>if</span></a> defined(MACRO)`.</p>
Foone🏳️‍⚧️<p>I love finding a function in a game that is literally just<br>void func(const char*){<br>}</p><p>No body. But it's called from 440 different places in the exe.</p><p>you can just smell the <a href="https://digipres.club/tags/IFDEF" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IFDEF</span></a> DEBUGMODE in the binary</p>
mcc<p><span class="h-card"><a href="https://mastodon.social/@ShadSterling" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ShadSterling</span></a></span> <span class="h-card"><a href="https://mstdn.social/@streganil" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>streganil</span></a></span> <span class="h-card"><a href="https://infosec.exchange/@MarkHegreberg" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>MarkHegreberg</span></a></span> But my experience with msys2 is it only works 90% of the time. The problem is that most C software is written to *assume* that <a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> MSVC means you are on Windows and being on Windows means <a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> MSVC is set. A startling amount of open source software barfs in msys2's windows-target mode because it detects "I'm in GCC… I guess I'm targeting a POSIX OS".</p><p>So now I use WSL. One prompt. Actual Linux. Can invoke exes in the Windows %PATH%… … usually :(</p>
Joshua M. Clulow<p><span class="h-card"><a href="https://octodon.social/@fasterthanlime" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>fasterthanlime</span></a></span> As a long term user and developer of a niche OS, I am always relieved not to be the first <a href="https://m.unix.house/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> or #[cfg(target_os)] when I go to port something.</p>
Foone🏳️‍⚧️<p>I think if you write a function like:</p><p>void debugPrint(char *message){<br><a href="https://digipres.club/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> DEBUG<br> fprintf(stderr, "ERROR: %s\n", message);<br><a href="https://digipres.club/tags/endif" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>endif</span></a> <br>}</p><p>watcom will still compile it, to a function that does nothing, and it just does some stack manipulation and then throws it away.</p>