filtoid

joined 7 months ago
[–] [email protected] 2 points 6 hours ago* (last edited 6 hours ago)

You are correct, I had misremembered how it works. It can evaluate build arguments, but they have to be numerical. However you can define new variables (in the pre-processor, not in code - ie, after a #) to replace those numbers, to make the intent clearer. Eg.

#define DEBUG_1 1

#define DEBUG_2 2

#if DEBUG_LEVEL >= DEBUG_1

Then pass the build arg DEBUG_LEVEL at compile time

More info here:

https://learn.microsoft.com/en-us/cpp/preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp?view=msvc-170

Edit: formatting of code snippet

[–] [email protected] 1 points 10 hours ago (2 children)

I'm going to take a shot at answering this, but please bear in mind that it's been a long time since I looked into the C pre-parser.

#if allows for arbitrary Boolean logic, eg #if build_env "local"

#if defined us to see if a thing has been defined already, quite often used to make sure that a header file is only imported once, redeclaration of headers is a compiler error. Eg. #if !defined(__SOME_UNIQUE_FILE_IDENTIFIER) (then define the class) then write your #endif

#ifdef wasn't always standard and was added later in the ANSI spec be a keyword, it's shorthand for the same thing as #if defined. -

This is my understanding anyway, I'm going with the principal that someone who knows more will be more likely to post a rebuttal (which I encourage).

[–] [email protected] 17 points 2 days ago (1 children)

Unfortunately masks are most effective when the person with COVID wears them, rather than people who are trying to avoid COVID, but human nature is such that people with COVID (ones who go out in public) are often ones least worried about it so least likely to wear a mask in the first place.

I had a similar experience where I went to a conference and masked up religiously around groups only to catch it anyway while my colleagues didn't mask and didn't catch it.

Sometimes you can do everything right and still fail (paraphrasing Picard).

[–] [email protected] 35 points 3 weeks ago

If he were my boss I'd ignore him during work hours too, tbh.

[–] [email protected] 10 points 4 weeks ago

I agree, the job of politicians is to reframe Trans rights as policies that benefit everyone. If everyone at a negotiation feels like they are winning you have a successful negotiation. Who cares if the new policy disproportionately benefits one group, we are all better off because of it, and in the case of Trans rights give them the same (non-codified) protections as everyone else.

(This is if course ignoring the oft used tactic of the far right which is to do the opposite and reframe beneficial policies (eh. ACA) as something that only benefits one group by calling it a funny name (eg. Obamacare), so it's easier said than done, but that is what the democrats should be doing more of, imho)

[–] [email protected] 3 points 1 month ago

You forgot KN#CKERS

[–] [email protected] 6 points 1 month ago (1 children)

First visit to the vet plays out like an Abbot and Costello sketch!

[–] [email protected] 5 points 1 month ago (1 children)
[–] [email protected] 5 points 1 month ago (1 children)

I live in Luxembourg and I have the same question!

I suspect it is trains going outside of the country but it's funny to see nonetheless. I think most trains originate from Luxembourg (when travelling to other countries over anything that would be considered a long distance which I suspect gives them a scheduling advantage).

[–] [email protected] 4 points 2 months ago

plus ça change, plus c'est la même chose

(The more things change, the more they stay the same)

[–] [email protected] 8 points 2 months ago

I mean, yeah, he'd have to hold the phone, no way that thing would stay the nook of his shoulder with a neck like that!

 

I've heard of Pythonistas and Rustaceans. What are some of the other names given to devs writing in, for example, PHP or C++. Appreciate any answers - both serious and joking.

view more: next ›