summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-16 11:02:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-16 11:02:40 -0300
commite1ceea56740ea119e4ead68c4389407024da523d (patch)
treecd989395876b991ad40db004ef45ef5c085044ee
parent748d6d4e7a1ac247071f6354f2700d1d0ee46b24 (diff)
downloadlua-github-e1ceea56740ea119e4ead68c4389407024da523d.tar.gz
Cleaner definition for macro 'ttisclosure'
-rw-r--r--lobject.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lobject.h b/lobject.h
index 1cc8e757..470b17d5 100644
--- a/lobject.h
+++ b/lobject.h
@@ -570,10 +570,11 @@ typedef struct Proto {
#define LUA_VCCL makevariant(LUA_TFUNCTION, 2) /* C closure */
#define ttisfunction(o) checktype(o, LUA_TFUNCTION)
-#define ttisclosure(o) ((rawtt(o) & 0x1F) == LUA_VLCL)
#define ttisLclosure(o) checktag((o), ctb(LUA_VLCL))
#define ttislcf(o) checktag((o), LUA_VLCF)
#define ttisCclosure(o) checktag((o), ctb(LUA_VCCL))
+#define ttisclosure(o) (ttisLclosure(o) || ttisCclosure(o))
+
#define isLfunction(o) ttisLclosure(o)