]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Convert enum return value of C function to underlying type.
authorMike Pall <mike>
Wed, 26 Jan 2011 13:18:12 +0000 (14:18 +0100)
committerMike Pall <mike>
Wed, 26 Jan 2011 13:18:12 +0000 (14:18 +0100)
src/lj_ccall.c

index 3881ad50254d9fa56a77f6521a7aa70539736a32..ece775a9441eea7947a31b6689b154f324cee028 100644 (file)
@@ -408,6 +408,7 @@ static int ccall_get_results(lua_State *L, CTState *cts, CType *ct,
 #endif
   /* No reference types end up here, so there's no need for the CTypeID. */
   lua_assert(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info)));
+  if (ctype_isenum(ctr->info)) ctr = ctype_child(cts, ctr);
   return lj_cconv_tv_ct(cts, ctr, 0, L->top-1, (uint8_t *)sp);
 }