libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_pointer.h
Go to the documentation of this file.
1/*! \file
2 * \brief Pointer and opaque type registration and checking
3 * \ingroup meta
4 *
5 * \author Falco Girgis
6 */
7
8#ifndef GIMBAL_POINTER_H
9#define GIMBAL_POINTER_H
10
11#include "../classes/gimbal_primitives.h"
12
13/// \ingroup metaBuiltinTypes
14#define GBL_POINTER_TYPE (GBL_BUILTIN_TYPE(POINTER))
15#define GBL_FUNCTION_TYPE GBL_POINTER_TYPE
16#define GBL_POINTER_TYPE_CHECK(type) (GblType_check(type, GBL_POINTER_TYPE))
17
18#define GblPointer_type() GBL_POINTER_TYPE
19#define GblFunction_type() GBL_FUNCTION_TYPE
20
21GBL_STATIC_ASSERT_MSG(sizeof(void*) == sizeof(GblFnPtr),
22 "Type system assumes function pointers can be stored within void*!");
23
24
26
27GBL_EXPORT GblType GblPointer_register(const char* pName) GBL_NOEXCEPT;
28
30
31#endif // GIMBAL_POINTER_H
#define GBL_BUILTIN_TYPE(prefix)
Returns a type from the macro prefix of a builtin type.
#define GBL_STATIC_ASSERT_MSG(cond, msg)
#define GBL_NOEXCEPT
#define GBL_DECLS_BEGIN
#define GBL_EXPORT
#define GBL_FUNCTION_TYPE
void(* GblFnPtr)()
Type used for holding an untyped function pointer.
#define GBL_POINTER_TYPE
uintptr_t GblType
Meta Type UUID.
Definition gimbal_type.h:51