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)
|
# define nil ((void *)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__cplusplus) && !defined(true)
|
|
||||||
# define true ((bool)1)
|
|
||||||
#endif
|
|
||||||
#if !defined(__cplusplus) && !defined(false)
|
|
||||||
# define false ((bool)0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef offsetof
|
#ifndef offsetof
|
||||||
# define offsetof(type, member) __builtin_offsetof(type, member)
|
# define offsetof(type, member) __builtin_offsetof(type, member)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef long double f128;
|
||||||
/* TODO: This is probably not a good idea */
|
/* TODO: This is probably not a good idea */
|
||||||
# define __neo_atomic_type volatile int
|
# define __neo_atomic_type volatile int
|
||||||
#else
|
#else
|
||||||
typedef _Bool bool;
|
# include <stdbool.h>
|
||||||
# ifdef __STDC_NO_ATOMICS__
|
# ifdef __STDC_NO_ATOMICS__
|
||||||
# error "Atomic types are not implemented"
|
# error "Atomic types are not implemented"
|
||||||
# else
|
# else
|
||||||
|
@ -64,6 +64,12 @@ struct _neo_nref {
|
||||||
typedef struct _neo_nref nref_t;
|
typedef struct _neo_nref nref_t;
|
||||||
#define NREF_FIELD nref_t __neo_nref
|
#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 {
|
struct _neo_string {
|
||||||
/* The *amount of Unicode code points*, NOT amount of bytes */
|
/* The *amount of Unicode code points*, NOT amount of bytes */
|
||||||
NLEN_FIELD(_len);
|
NLEN_FIELD(_len);
|
||||||
|
@ -77,7 +83,6 @@ typedef struct _neo_string string;
|
||||||
struct _neo_error {
|
struct _neo_error {
|
||||||
string *_message;
|
string *_message;
|
||||||
u32 _number;
|
u32 _number;
|
||||||
u32 _flags; /* see src/error.c */
|
|
||||||
};
|
};
|
||||||
typedef struct _neo_error error;
|
typedef struct _neo_error error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue