Compare commits
2 commits
d561ff3fa9
...
f120bcc02a
Author | SHA1 | Date | |
---|---|---|---|
f120bcc02a | |||
528be61971 |
2 changed files with 8 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue