Explorar o código

FFI: Convert enum return value of C function to underlying type.

Mike Pall %!s(int64=14) %!d(string=hai) anos
pai
achega
30db71e2e2
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/lj_ccall.c

+ 1 - 0
src/lj_ccall.c

@@ -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);
 }