Compare commits

...

2 commits

Author SHA1 Message Date
fef
f120bcc02a
types: use bool typedefs from stdbool.h 2021-07-21 16:46:17 +02:00
fef
528be61971
error: remove unused _flags member 2021-07-19 22:36:05 +02:00
2 changed files with 8 additions and 10 deletions

View file

@ -10,13 +10,6 @@
# define nil ((void *)0)
#endif
#if !defined(__cplusplus) && !defined(true)
# define true ((bool)1)
#endif
#if !defined(__cplusplus) && !defined(false)
# define false ((bool)0)
#endif
#ifndef offsetof
# define offsetof(type, member) __builtin_offsetof(type, member)
#endif

View file

@ -27,9 +27,9 @@ typedef long double f128;
#ifdef __cplusplus
/* TODO: This is probably not a good idea */
#define __neo_atomic_type volatile int
# define __neo_atomic_type volatile int
#else
typedef _Bool bool;
# include <stdbool.h>
# ifdef __STDC_NO_ATOMICS__
# error "Atomic types are not implemented"
# else
@ -64,6 +64,12 @@ struct _neo_nref {
typedef struct _neo_nref nref_t;
#define NREF_FIELD nref_t __neo_nref
struct _neo_nmut {
__neo_atomic_type _lock;
};
typedef struct _neo_nmut nmut_t;
#define NLOCK_FIELD nmut_t __neo_nmut
struct _neo_string {
/* The *amount of Unicode code points*, NOT amount of bytes */
NLEN_FIELD(_len);
@ -77,7 +83,6 @@ typedef struct _neo_string string;
struct _neo_error {
string *_message;
u32 _number;
u32 _flags; /* see src/error.c */
};
typedef struct _neo_error error;