From 392c9aff947a41e7e0da0b1a9612e174cfa956a7 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sat, 18 Apr 2020 13:30:03 -0700 Subject: test: added prime sieve test of coroutines --- include/u.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'include/u.h') 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])) -- cgit v1.2.1