diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-04-18 13:30:03 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-04-18 13:30:03 -0700 |
commit | 392c9aff947a41e7e0da0b1a9612e174cfa956a7 (patch) | |
tree | ae45404b07da46490c6dcd0a09b82fd3a3dcf2e3 /include | |
parent | 1d188c4f816fce8728fdffaa7ad6ef205ca05abd (diff) |
test: added prime sieve test of coroutines
Diffstat (limited to 'include')
-rw-r--r-- | include/u.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/u.h b/include/u.h index b7bd9ca..c03d545 100644 --- a/include/u.h +++ b/include/u.h @@ -51,6 +51,8 @@ typedef intptr_t intptr; typedef int error;
+typedef void* Iface;
+
#define nil NULL
// ----------------------------------------------------------------------------
@@ -90,9 +92,9 @@ void _bufpop(void*, int, vlong); typedef struct coro coro;
-coro* coro·new(uintptr stk, uintptr (*func)(coro* c, uintptr));
-uintptr coro·yield(coro* c, uintptr arg);
-error coro·free(coro* c);
+coro* coro·new(uintptr stk, uintptr (*func)(coro*, uintptr));
+uintptr coro·yield(coro *c, uintptr arg);
+error coro·free(coro *c);
// -----------------------------------------------------------------------------
// Strings
@@ -107,10 +109,10 @@ error coro·free(coro* c); // ------------------------------------------------------------------
// Global macros
-#ifndef RELEASE
-#define Assert(x) assert(x)
-#else
+#ifdef RELEASE
#define Assert(x)
+#else
+#define Assert(x) assert(x)
#endif
#define arrlen(Array) (sizeof(Array) / sizeof((Array)[0]))
|