From a45945b6d511b00b1c84dc73881474030737e956 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 19 Apr 2017 13:34:35 -0300 Subject: new macro 'lua_pointer2str' to encapsulate use of 'l_sprintf' inside the kernel --- luaconf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index 118f997a..33ff3604 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.258 2016/12/20 18:37:00 roberto Exp roberto $ +** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -620,6 +620,13 @@ #endif +/* +@@ lua_pointer2str converts a pointer to a readable string in a +** non-specified way. +*/ +#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) + + /* @@ lua_number2strx converts a float to an hexadecimal numeric string. ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. -- cgit v1.2.3-55-g6feb