diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 14:20:14 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-17 14:20:14 -0500 |
| commit | 21a35cbc4587374c4f18c690e9f4d40e725a6033 (patch) | |
| tree | 719625fae926669ec2d95116e0b97cab6b3eaedc /builtins/pointer.h | |
| parent | 8ebf9bd3adf232930e3a4f5ca089d51595b93adf (diff) | |
Getting back to old typeinfo stuff from SSS
Diffstat (limited to 'builtins/pointer.h')
| -rw-r--r-- | builtins/pointer.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/builtins/pointer.h b/builtins/pointer.h new file mode 100644 index 00000000..b8583b72 --- /dev/null +++ b/builtins/pointer.h @@ -0,0 +1,16 @@ +#pragma once +#include <gc/cord.h> +#include <stdbool.h> +#include <stdint.h> + +#include "types.h" + +CORD Pointer__cord(const void *x, bool colorize, const TypeInfo *type); +int32_t Pointer__compare(const void *x, const void *y, const TypeInfo *type); +bool Pointer__equal(const void *x, const void *y, const TypeInfo *type); +uint32_t Pointer__hash(const void *x, const TypeInfo *type); + +#define POINTER_TYPE(_sigil, _pointed) (&(TypeInfo){\ + .size=sizeof(void*), .align=alignof(void*), .tag=PointerInfo, .PointerInfo.sigil=_sigil, .PointerInfo.pointed=_pointed}) + +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
