eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

205
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>
scunneen (he/him) 🚋<p><span class="h-card" translate="no"><a href="https://mastodon.gamedev.place/@eniko" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>eniko</span></a></span> Or add an equivalent of <a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> so you can have platform specific code for multiple platforms inside the same function</p>
C.<p><span class="h-card" translate="no"><a href="https://digipres.club/@foone" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>foone</span></a></span> </p><p>Agreed, but there's also a lot of `<a href="https://mindly.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> __GNU_SOURCE` and such in the open-source world, too.</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>
mx alex tax1a - 2020 (5)<p><span class="h-card" translate="no"><a href="https://mastodon.mit.edu/@amsomniac" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>amsomniac</span></a></span> c programmers posting here know about the <code>#ifdef</code> hashtag</p>
SpaceLifeForm<p><span class="h-card" translate="no"><a href="https://mastodon.social/@bigzaphod" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>bigzaphod</span></a></span> </p><p>Using a C toolchain, I would -Dname from command line, which gets passed to pre-compiler (the frontend), and inside your source code, you conditionally compile using <a href="https://infosec.exchange/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> and/or <a href="https://infosec.exchange/tags/ifndef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifndef</span></a> .</p><p><a href="https://infosec.exchange/tags/Coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Coding</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>
Red Lucy<p>I removed a couple ´<a href="https://wetdry.world/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a>´'s lmao</p><p>this is likely not even a third of all ifdef define macro shenanigans in this codebase :blobfoxterrified:</p>
mx alex tax1a - 2020 (5)<p>the bulk of the thing is a single large C file with <code>#ifdef __irix__</code> and <code>#ifdef __alpha__</code> scattered around</p>
Dave Anderson<p>Skimming these shaders also means you come across really tantalizing "I'm sure this makes sense if I go figure it out, but, wat" things. For instance, "<a href="https://hachyderm.io/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> USE_17_SAMPLES" raises many questions for me.</p>
daniel:// stenberg://<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@kees" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>kees</span></a></span> <span class="h-card" translate="no"><a href="https://norden.social/@hikhvar" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>hikhvar</span></a></span> <span class="h-card" translate="no"><a href="https://infosec.exchange/@dascandy" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>dascandy</span></a></span> yeah, that's basically what I found in the curl code left from &lt; 2000. Mostly comments and a few <a href="https://mastodon.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a>/#defines.</p>
Mimir<p>strongly recommend following the <a href="https://meow.social/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> hashtag on here</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>
Alex Russell<p><span class="h-card" translate="no"><a href="https://digipres.club/@misty" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>misty</span></a></span> it's particularly wild because:</p><p>a.) there was so much divergence *pre*-fork; e.g., different JS engines, IDL systems, network stacks, process model, 3D subsystem, media engines, and feature set (via *many* runtime flags and <a href="https://toot.cafe/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a> differences)</p><p>b.) that has gotten *much* larger! Since the fork, Blink rewrote the layout engine (LayoutNG), font handling, and implemented dozens of features that aren't in WebKit yet</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>
Riley S. Faelan<p><span class="h-card" translate="no"><a href="https://bitbang.social/@procrastin8" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>procrastin8</span></a></span> By "running C efficiently", I assume you mean proper facilities for stack data storage.</p><p>So, I've been playing around with porting some C++ code, originally from Unix world, sort of, to PC DOS and 8086 recently. Mostly, for hack value, partly also in the hope that I'll be able to run the resulting code in a tiny 16-bit CPU living in an FPGA project. I've found the experience of having plenty of legitimate pointers pointing outside my own program's memory, and of having to manage the segmented architecture's weirdness, quite educational. Eventually, I want to give a try to smarter-than-VROOMM overlay management and reasonably portable Synthesis-like quajects, and quajects' value is particularly illuminative in tiny systems.</p><p>=&gt; I think I could gain interesting insights by learning to wrestle with the 8-bit systems' weirdnesses in a high-level programming style, without keeping my focus on hand-assemblying the parts of the code where standard compilation techniques could generate reasonable code, but on <a href="https://toot.cat/tags/ifdef" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifdef</span></a>:ing in the interesting parts.</p><p>(Also, the code already uses recursion quite sparingly, because, well, tiny 16-bit CPU living in an FPGA could have shortage of allotted stack space.)</p>