diff --git a/include/neo/_stddef.h b/include/neo/_stddef.h index 4e80609..db51a4a 100644 --- a/include/neo/_stddef.h +++ b/include/neo/_stddef.h @@ -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 diff --git a/include/neo/_types.h b/include/neo/_types.h index 80e1daf..c4f445f 100644 --- a/include/neo/_types.h +++ b/include/neo/_types.h @@ -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 # 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);