Zen-C
Loading...
Searching...
No Matches
compat.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ZC_AUTO   __auto_type
 GCC/Clang extension.
 
#define ZC_CAST(T, x)   ((T)(x))
 Explicit cast.
 
#define ZC_REINTERPRET(T, x)   ((T)(x))
 Reinterpret cast.
 
#define ZC_EXTERN_C
 Extern "C" (no-op in C).
 
#define ZC_EXTERN_C_BEGIN
 
#define ZC_EXTERN_C_END
 
#define ZC_TCC_COMPAT_STR
 
#define ZC_C_GENERIC_STR
 
#define ZC_C_ARG_GENERIC_STR    "#define _z_arg(x) _Generic((x), _Bool: _z_bool_str(x) _z_objc_arg_map(x), default: (x))\n"
 

Macro Definition Documentation

◆ ZC_AUTO

#define ZC_AUTO   __auto_type

GCC/Clang extension.

◆ ZC_C_ARG_GENERIC_STR

#define ZC_C_ARG_GENERIC_STR    "#define _z_arg(x) _Generic((x), _Bool: _z_bool_str(x) _z_objc_arg_map(x), default: (x))\n"

◆ ZC_C_GENERIC_STR

#define ZC_C_GENERIC_STR
Value:
"#ifdef __OBJC__\n" \
"#define _z_objc_map ,id: \"%s\", Class: \"%s\", SEL: \"%s\"\n" \
"#define _z_objc_arg_map(x) ,id: [(id)(x) description].UTF8String, Class: " \
"class_getName((Class)(x)), SEL: sel_getName((SEL)(x))\n" \
"#else\n" \
"#define _z_objc_map\n" \
"#define _z_objc_arg_map(x)\n" \
"#endif\n" \
"\n" \
"#define _z_str(x) _Generic((x), _Bool: \"%s\", char: \"%c\", " \
"signed char: \"%c\", unsigned char: \"%u\", short: \"%d\", " \
"unsigned short: \"%u\", int: \"%d\", unsigned int: \"%u\", " \
"long: \"%ld\", unsigned long: \"%lu\", long long: \"%lld\", " \
"unsigned long long: \"%llu\", float: \"%f\", double: \"%f\", " \
"char*: \"%s\", void*: \"%p\" _z_objc_map)\n"

◆ ZC_CAST

#define ZC_CAST (   T,
 
)    ((T)(x))

Explicit cast.

◆ ZC_EXTERN_C

#define ZC_EXTERN_C

Extern "C" (no-op in C).

◆ ZC_EXTERN_C_BEGIN

#define ZC_EXTERN_C_BEGIN

◆ ZC_EXTERN_C_END

#define ZC_EXTERN_C_END

◆ ZC_REINTERPRET

#define ZC_REINTERPRET (   T,
 
)    ((T)(x))

Reinterpret cast.

◆ ZC_TCC_COMPAT_STR

#define ZC_TCC_COMPAT_STR
Value:
"#ifdef __TINYC__\n" \
"#ifndef __auto_type\n" \
"#define __auto_type __typeof__\n" \
"#endif\n" \
"\n" \
"#ifndef __builtin_expect\n" \
"#define __builtin_expect(x, v) (x)\n" \
"#endif\n" \
"\n" \
"#ifndef __builtin_unreachable\n" \
"#define __builtin_unreachable()\n" \
"#endif\n" \
"#endif\n"