From 1aa4f69b51a92dc4f5c9d35925b9977d35650679 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Jul 2014 10:53:37 -0300 Subject: new type 'lua_Ctx' for continuation-function contexts (to allow type to be configurable) --- luaconf.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index 65ee1eff..b477319b 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.208 2014/06/24 17:02:00 roberto Exp roberto $ +** $Id: luaconf.h,v 1.209 2014/06/26 18:30:27 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -254,6 +254,22 @@ #define LUAI_MAXSHORTLEN 40 +/* +@@ LUA_CTXT is the type of the context ('ctx') for continuation functions. +@@ It must be a numerical type; Lua will use 'intptr_t' if available. +*/ +#if defined (LUA_USE_C99) +#include +#if defined (INTPTR_MAX) /* even in C99 this type is optional */ +#define LUA_CTXT intptr_t +#endif +#endif + +#if !defined(LUA_CTXT) +/* default definition (the nearest thing to 'intptr_t' in C89) */ +#define LUA_CTXT ptrdiff_t +#endif + /* ** {================================================================== -- cgit v1.2.3-55-g6feb