I'm aware the export dialog had a field where excluded files can be specified, but it's a bit basic. Ideally I'd love to have something like this:
#ifdef DEMO_MODE
[file list to exclude from demo mode]
#else
[file list to exclude from full version]
#endif
Windows App Development CLI v0.2: .NET support, manifest placeholders, "winapp store" and more! - #ifdef Windows devblogs.microsoft.com/ifdef-window...
So far I'm enjoying #C++ modules a lot. To me it is far more elegant than dealing with header files, #pragma, #ifdef, etc.
That said, it was no fun getting the compiler to work, I had to give up on macOS completely and move back to Linux (which is for the best).
No, I got it. The attribute on the method was the closest thing I found. And yes, you still have to gate it behind the #ifdef, but perhaps it's only one ifdef to add around the attribute vs. all the ones in the previous example, which admittedly look a bit awkward.
Is there a tool that can scan a C codebase and show all preprocessor switches that I might want to define with `-DENABLE_FOO=1`?
Obviously there are many edge cases, but even a simple script that finds all identifiers used inside #if, #ifdef, etc. (except for include guards) would be really useful.
TIL about a great cpp pattern: define a constexpr bool in #ifdef, and use "if constexpr" for the rest of the file, instead of ungodly ifdefs
XAML Studio is now Open Sourced - #ifdef Windows devblogs.microsoft.com/ifdef-window... #XAML #WinUI3
"should monogamous people test for STDs" #ifdef is of the devil, but also, yeah probably
You cannot.
But ... you can work around it. Look at `RcppAPT`, it is even less general as it works only on some Linuxes. I control for that with a test in `configure` and #ifdef'ed checks. I use similarly logic in other packages that need specific resources (eg RblpApi for Bloomberg access).
רוצה לדעת מה עשיתי אתמול?
דילוורתי גריט של comment \\ מעל #ifdef
#ifdef 🏳️🌈
Hey Graphics Bluesky! I'm in Breda to give a talk on Slang-- I'm up Wednesday at 16:00. This one will cover Slang's features for making large shader codebases a breeze to work with, and avoiding #ifdef hell.
Check it out, or catch me at the conference if you have Slang Qs!
#ifdef _WIN32 time
*Or* it's a feature. The Linux maintainer deciding "naw, I don't want this stupid copilot feature so I'm just gonna #ifdef the code, and bosses will never notice tee hee". 😋
Announcing WinUI Gallery 2.7 - #ifdef Windows devblogs.microsoft.com/ifdef-window...
Looking at sokol_gfx.h, did you maybe override SOKOL_ASSERT? If this is active in release mode it would cause glGetError to be called. I guess I will also add an #ifdef SOKOL_DEBUG around it just to be sure it's off in release mode...
J'ai buggé 1h sur un code qui refusait de compiler parce que j'avais accidentellement bougé une ligne d'un #ifdef valide à son #else invalide (alt+bas sûrement)
Shader programming really isn't my métier.
I can *read* this (~WGSL) code, but I don't fully understand it and it's a hellscape of visual noise with all this #define and #ifdef. I just want to adjust the texture sampling a bit 🥲
…but we ran out of time. We needed lobbies, scripts working over network etc. We decided to cut the effort.
#ifdef GTA_NETWORK in the source code is a leftover.
What's intriguing there is using conditional compilation (#define, #ifdef, etc.) to build C++ classes that include BOTH sets of platform-specific calls in the same methods:
#ifdef ANDROID
/* Speak Android JNI natively */
#endif
#ifdef IOS
/* Speak Objective C++ natively */
#endif
Nice straight forward technique.
Putting the option for each compiler into an `#ifdef` block would make it a library option
```
#ifdef __GNUC__
asm_macro def
#else
vs_native_macro def
#endif
```
@eri @sterophonick they just have `#ifdef`s for the new features