Browse Source

Cleaner definition for macro 'ttisclosure'

Roberto Ierusalimschy 4 years ago
parent
commit
e1ceea5674
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lobject.h

+ 2 - 1
lobject.h

@@ -570,10 +570,11 @@ typedef struct Proto {
 #define LUA_VCCL	makevariant(LUA_TFUNCTION, 2)  /* C closure */
 #define LUA_VCCL	makevariant(LUA_TFUNCTION, 2)  /* C closure */
 
 
 #define ttisfunction(o)		checktype(o, LUA_TFUNCTION)
 #define ttisfunction(o)		checktype(o, LUA_TFUNCTION)
-#define ttisclosure(o)		((rawtt(o) & 0x1F) == LUA_VLCL)
 #define ttisLclosure(o)		checktag((o), ctb(LUA_VLCL))
 #define ttisLclosure(o)		checktag((o), ctb(LUA_VLCL))
 #define ttislcf(o)		checktag((o), LUA_VLCF)
 #define ttislcf(o)		checktag((o), LUA_VLCF)
 #define ttisCclosure(o)		checktag((o), ctb(LUA_VCCL))
 #define ttisCclosure(o)		checktag((o), ctb(LUA_VCCL))
+#define ttisclosure(o)         (ttisLclosure(o) || ttisCclosure(o))
+
 
 
 #define isLfunction(o)	ttisLclosure(o)
 #define isLfunction(o)	ttisLclosure(o)