Trending

#endif

Latest posts tagged with #endif on Bluesky

Latest Top
Trending

Posts tagged #endif

les chefs de projets à la con, en c++ /c avec du code à conserver au cas où : lui pourquoi t'as pas mis en /* , bin parce qu'il y a déjà des commentaires en /* et que ça va être chiant à dé commenter ,
#IF 0
//code mort yyyymmdd
#ENDIF
je n'aime pas ça, les dev "oui mais c'est connu,andouille"

0 0 1 0

Geez, Apple. Get your house in order.

```swift
#if targetEnvironment(simulator)
import Foundation
#else
#if os(macOS)
@preconcurrency import NetworkExtension
#else
import NetworkExtension
#endif
#endif
```

1 0 0 0

#ifdef CONSENT_TO_WINDOWS_H
#include <windows.h>
#endif
at least put a guard smh

6 0 2 0

#ifndef __LED_H //这是防止重复的语句,意思是if not define 如果没有定义,则执行该.h文件
#define __LED_H //上面一句如果确认如果Led.h确实没有被define,那么开始define

/*
函数函数函数
*/

#endif

0 0 0 0

#endif
😅
Jo. Wer weiß. Oder Mandarin.

2 0 2 0
Preview
calcEntry, ifEntry: Added examples of #if with #calc and verbatim string · OpenFOAM/OpenFOAM-dev@096c63e OpenFOAM Foundation development repository. Contribute to OpenFOAM/OpenFOAM-dev development by creating an account on GitHub.

Improved the .#if ... .#else ... .#endif syntax for case configuration files in #OpenFOAM-dev github.com/OpenFOAM/OpenFOAM...

1 0 0 0

What in the #ifdef #endif is going on here!?

0 0 0 0

ほんと、全然知らない、勉強不足を実感

ヘッダーファイルに

#ifndef _XX_H_
#define _XX_H_
……
#endif

と書いてインクルードガードとは。
なるほどねぇ

他人のソースを読むのは勉強になるなぁ

1 0 0 0

#ifdef BBDQ
code
#else
other code
#endif

0 0 0 0

#ifndef _SHH_AVAILABILITY_H
#define _SHH_AVAILABILITY_H

#include <Availability.h>

#undef API_UNAVAILABLE
#define API_UNAVAILABLE(...)
#undef API_PROHIBITED
#define API_PROHIBITED(...)
#undef __API_UNAVAILABLE
#define __API_UNAVAILABLE(...)

#endif

clang -include ShhhAvailability.h …

2 0 0 0

I tend to leave potentially useful code inside #if #endif so I can switch it back in easily if it is multiple lines. Then, many days later I can have a tidy up and remove the unrequired lumps once I am pretty sure everything is working. Fine for a single-programmer project, not good for a team.

1 0 0 0

huh, I thought ublock origin rules could be parsed line-by-line, but turns out they can't be

bc you can have if directives in them, like


!#if env_mobile
example.com##.my-mobile-class
!#else
example.com##.my-desktop-class
!#endif


TIL

0 0 0 0
Original post on social.mikutter.hachune.net

もしかして:/usr/local/lib/X11/config/X11.tmplが腐ってる…?
#define XinitDir $(LIBDIR)/xinit
んでもって
#ifndef LibDir
# ifdef ProjectRoot
# define LibDir Concat(ProjectRoot,/lib/X11)
# else
# define LibDir /usr/lib/X11
# endif
#endif

この結果を受けて
LIBDIR = /usr/X11R6/lib/X11
XINITDIR = $(LIBDIR)/xinit
となるけど、実際は

ua […]

0 0 1 0
Post image

Still always making strange code

#if 0
#pysea.c
#polyglot-file
import sys
print ('Hello, world - Python\ngcc -o pysea', sys.argv[0])
#endif

#include <stdio.h>
#define exit int main(int argc, char** argv)
#define quit { printf ("Hello, world - C.\npython3 %s.c\n", argv[0]); return 0; }

exit
quit

1 0 0 0
Original post on scoat.es

#Swift folks (especially @mattiem ):

With Swift 6.2’s new concurrency checking/rejecting on Actor’s `static var …`, is it safe-enough to do something like this for dependency injection?

```swift
struct Config {
nonisolated(unsafe) private static var _shared: Self = .init()
#if TESTING
static […]

0 0 2 0

#if defined(__alpha__) && defined(CONFIG_PCI)
/*
* The meaning of life, the universe, and everything. Plus
* this makes the year come out right.
*/
year -= 42;
#endif

-- From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner

3 0 0 0

Another day, another #if 0 ... #endif bisect to find the code that crashes MSVC.

0 0 0 0

#ifdef AUTHORITARIANISM
habeusCorpus=FALSE;
#endif

0 0 0 0

I frequently typo
#endif
as
3endif

But it's the first time I came up with
#3ndif

as if my brain considered creating a variant

0 0 0 0

You can use “#if compiler(>=6.2)” as an alternative. That checks if the Xcode has Swift 6.2 which works with any Xcode version. So:

#if compiler(>=6.2)
some new iOS 26 api
#else
Fallback if needed
#endif

2 0 0 0
A code screenshot from Xcode where this conditional has a drop down menu at its corresponding #endif that offers to insert a conditional comment.

#if DEBUG && true

A code screenshot from Xcode where this conditional has a drop down menu at its corresponding #endif that offers to insert a conditional comment. #if DEBUG && true

First thing I notice when I launched Xcode 26 is that it's indicating what an #endif is associated with and offering to insert a conditional comment.

Very nice!

4 0 0 0

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

1 1 2 0

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
```

0 0 0 0

At least add them between some #ifdef DEBUG #endif flags!

1 0 0 0

#ifndef USE_SCRIPT
#define USE_SCRIPT
#endif
#ifndef USE_SML_M
#define USE_SML_M
#endif
#ifdef USE_RULES
#undef USE_RULES
#endif

#ifndef USE_SCRIPT_JSON_EXPORT
#define USE_SCRIPT_JSON_EXPORT
#endif
#ifndef USE_SCRIPT_WEB_DISPLAY
#define USE_SCRIPT_WEB_DISPLAY
#endif

0 0 0 0

Crash at line 9.
Line 9: #endif

5 0 0 0

Package traits SE-0450:

1. Define a trait as an arbitrary token. e.g. "Firebase"

2. Add Firebase as optional dependency when that trait is enabled

3. Conditionally compile
#if Firebase
import Firebase
...
#endif

4. A client of your package can enable "Firebase" to add related code and libraries.

2 0 2 0

I have my test thing being a separate executable whose entire purpose is... running each of the tests.

(I also put the tests inside an #if#endif block so the tests only get compiled if building a debug build.)

0 0 1 0

Oof. I don't think I see a way for constexpr class instances to auto-register in C++17 (hash <-> c_str); I mean, it's a side-effect.

constexpr H foo("foo");
int main() {
std::print("foo hash = {0}\n", foo.val());
#ifdef _DEBUG
std::print("foo str = {0}\n", Hashed::lookup(foo.val()));
#endif
}

0 0 0 0

// Don't alias here
#if defined( CPortal_Player )
#undef CPortal_Player
#endif

0 0 1 0