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

@jscholes Seemingly the merging of my dark mode PR made this bug surface, but I'll just let this diff speak for itself. diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp
index 435e7aae6f0c..3c6bb349cd8c 100644
--- a/src/common/wincmn.cpp
+++ b/src/common/wincmn.cpp
@@ -3887,15 +3887,7 @@ wxAccStatus wxWindowAccessible::GetName(int childId, wxString* name)
if (childId > 0)
return wxACC_NOT_IMPLEMENTED;

- // This will eventually be replaced by specialised
- // accessible classes, one for each kind of wxWidgets
- // control or window.
-#if wxUSE_BUTTON
- if (wxDynamicCast(GetWindow(), wxButton))
- title = ((wxButton*) GetWindow())->GetLabel();
- else
-#endif
- title = GetWindow()->GetName();
+ title = GetWindow()->GetLabel();

if (!title.empty())
{

@eniko IME, it will stop doing that in MSVC at some small nesting level.

Useful macros:

#if _MSC_VER > 0
#define INLINE __forceinline
#else
#define INLINE __attribute__((always_inline)) inline
#endif

@feuer toi lienee ihan ok, mutta jos ymmärrän tilanteen oikein niin tyypillinen ratkaisu tähän on kai sanoa headerissa

#ifdef __cplusplus
extern "C" {
#endif

(sisältö)

#ifdef __cplusplus
}
#endif

というか
#include
とか
#if
#endif
とかCの機能をママ使える謎言語
@dotstdy I've definitely used such compilers in the past. Their apparent attitude was, "#include includes exactly the bytes of that file into the translation unit at this point", so if the included file didn't end with a newline, it effectively concatenated the next input line onto the end of the final "line" of the included file. And because most header files end with "#endif", and most compilers ignore any junk on the same line following an "'#endif", it effectively ignored the next input line completely, causing confusing errors.
@drahardja Looks like I want this “Condition on #endif line” turned off.

@shugo gcc -EするとNULLが/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.hでdefineされていることがわかって、下記のように、Cなら(void *)に、C++なら整数になるみたいです。

:
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
#define NULL 0
#endif /* C++ */
#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL
:

thinking of the namespace proposal for c, and, i wonder if, we couldn’t have namespaces done in the preprocessor, like:

/* lib.h */ #namespace lib lib_ void lib::foo(); /* declares lib_foo as a function name */ /* app.c */ #include <lib.h> #using lib::foo #using lib::foo as nya #using lib as MyApi int main(void) { /* all of those would be pre-processed to lib_foo() */ lib::foo(); foo(); nya(); MyApi::foo(); }

works with macros, and identifiers, basically anywhere a #define would also work

and could be backwards compatible, e.g. if i were to use it in openrc:

/* rc.h */ #ifdef _HAS_NAMESPACE #namespace rc rc_ #namespace RC RC_ #endif

now older c programs can still use rc_service_resolve, and newer ones can use rc::service_resolve (as well as #using directives)

including whole namespace, like #using lib, could work but it’d be a pain to implement i think, since the preprocessor would need to keep track of all lib_ it sees since #namespace was declared, and forward-replace them

but with or without whole-namespace-inclusion, this has really simple semantics and imo predictable errors, as namespacing conflicts can be reported the same way “redefinition” of macro names are

@tknarr it's c

c23 has a way to mimick visibility, by building with `-Dmylib_private` and having:

```c
#ifndef mylib_private
#define mylib_private [[deprecated("private member")]]
#endif
```

but tbh even without that it's also possible to just say "do not touch any undocumented field, you've been warned" -- it's not like c doesn't already have api constraints that live in documentation (e.g. "this pointer may/may-not be NULL"), the less of those we have the better but one step at a time with improving semantics