Derive-C
Loading...
Searching...
No Matches
require.h File Reference

Go to the source code of this file.

Macros

#define DC_REQUIRE_METHOD_EXPR(ret, obj, name, args)
#define DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, Type)
#define DC_REQUIRE_METHOD(ret, obj, name, args)
#define DC_REQUIRE_TYPE(obj, name)
#define DC_REQUIRE_CONSTANT_TYPE(obj, name, type)
#define DC_REQUIRE_CONSTANT(obj, name)

Macro Definition Documentation

◆ DC_REQUIRE_CONSTANT

#define DC_REQUIRE_CONSTANT ( obj,
name )
Value:
DC_STATIC_ASSERT(sizeof(NS(obj, name)), "Constant " #obj "." #name " must exist")
#define NS(pre, post)
Definition namespace.h:4
#define DC_STATIC_ASSERT
Definition panic.h:21

Definition at line 28 of file require.h.

28#define DC_REQUIRE_CONSTANT(obj, name) \
29 DC_STATIC_ASSERT(sizeof(NS(obj, name)), "Constant " #obj "." #name " must exist")

◆ DC_REQUIRE_CONSTANT_TYPE

#define DC_REQUIRE_CONSTANT_TYPE ( obj,
name,
type )
Value:
"Method " #obj "." #name " must exist and be of type " #type)
#define DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, Type)
Definition require.h:13

Definition at line 24 of file require.h.

24#define DC_REQUIRE_CONSTANT_TYPE(obj, name, type) \
25 DC_STATIC_ASSERT(DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, type), \
26 "Method " #obj "." #name " must exist and be of type " #type)

◆ DC_REQUIRE_CONSTANT_TYPE_EXPR

#define DC_REQUIRE_CONSTANT_TYPE_EXPR ( obj,
name,
Type )
Value:
_Generic((NS(obj, name)), Type: 1, default: 0)

Definition at line 13 of file require.h.

13 #define DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, Type) \
14 _Generic((NS(obj, name)), Type: 1, default: 0)

◆ DC_REQUIRE_METHOD

#define DC_REQUIRE_METHOD ( ret,
obj,
name,
args )
Value:
"Method " #obj "." #name " must exist with type " #ret " (*)" #args)
#define DC_REQUIRE_METHOD_EXPR(ret, obj, name, args)
Definition require.h:11

Definition at line 17 of file require.h.

17#define DC_REQUIRE_METHOD(ret, obj, name, args) \
18 DC_STATIC_ASSERT(DC_REQUIRE_METHOD_EXPR(ret, obj, name, args), \
19 "Method " #obj "." #name " must exist with type " #ret " (*)" #args)

◆ DC_REQUIRE_METHOD_EXPR

#define DC_REQUIRE_METHOD_EXPR ( ret,
obj,
name,
args )
Value:
_Generic(&NS(obj, name), ret(*) args: 1, default: 0)

Definition at line 11 of file require.h.

11 #define DC_REQUIRE_METHOD_EXPR(ret, obj, name, args) \
12 _Generic(&NS(obj, name), ret(*) args: 1, default: 0)

◆ DC_REQUIRE_TYPE

#define DC_REQUIRE_TYPE ( obj,
name )
Value:
DC_STATIC_ASSERT(sizeof(NS(obj, name)), "Type " #obj "." #name " must exist")

Definition at line 21 of file require.h.

21#define DC_REQUIRE_TYPE(obj, name) \
22 DC_STATIC_ASSERT(sizeof(NS(obj, name)), "Type " #obj "." #name " must exist")