rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit 66434a97cb02264eb569fa3c25c845e2150d2bc6
parent 25e4d795605da5c15967983f53325dd014d3e6b3
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Sat,  6 Jul 2024 16:39:53 -0700

Add c64 and c128 typedefs, and complex/imaginary pseudo-keywords

Diffstat:
Minc/def.h | 7+++++--
Minc/rcx.h | 9+++++++++
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/inc/def.h b/inc/def.h @@ -208,7 +208,7 @@ typedef int32_t isize; #define ISIZE_C INT64_C typedef int64_t isize; #else /* This won't happen except on weird archs */ -#error "Could not find suitable type for isize" +#error "Could not find a suitable type for isize" #endif #define U8_BITS 8 @@ -253,7 +253,7 @@ typedef uintptr_t uptr; #define USIZE_BITS 64 #define USIZE_C UINT64_C #else /* This won't happen except on weird archs */ -#error "Could not determine width of usize" +#error "Could not determine the width of usize" #endif #define USIZE_MAX SIZE_MAX typedef size_t usize; @@ -261,6 +261,9 @@ typedef size_t usize; typedef float f32; typedef double f64; +typedef _Complex float c64; +typedef _Complex double c128; + #define RUNE_BITS 32 #define RUNE_BAD RUNE_C(0xFFFD) #define RUNE_MAX RUNE_C(0x10FFFF) diff --git a/inc/rcx.h b/inc/rcx.h @@ -17,4 +17,13 @@ #endif #endif +/* Define the "complex"/"imaginary" pseudo-keywords without including all the + * other stuff in complex.h. */ +#ifndef complex +#define complex _Complex +#endif +#ifndef imaginary +#define imaginary _Imaginary +#endif + #include "def.h"