diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -334,6 +334,12 @@ struct lua_State { | |||
334 | 334 | ||
335 | /* | 335 | /* |
336 | ** Union of all collectable objects (only for conversions) | 336 | ** Union of all collectable objects (only for conversions) |
337 | ** ISO C99, 6.5.2.3 p.5: | ||
338 | ** "if a union contains several structures that share a common initial | ||
339 | ** sequence [...], and if the union object currently contains one | ||
340 | ** of these structures, it is permitted to inspect the common initial | ||
341 | ** part of any of them anywhere that a declaration of the complete type | ||
342 | ** of the union is visible." | ||
337 | */ | 343 | */ |
338 | union GCUnion { | 344 | union GCUnion { |
339 | GCObject gc; /* common header */ | 345 | GCObject gc; /* common header */ |
@@ -347,6 +353,11 @@ union GCUnion { | |||
347 | }; | 353 | }; |
348 | 354 | ||
349 | 355 | ||
356 | /* | ||
357 | ** ISO C99, 6.7.2.1 p.14: | ||
358 | ** "A pointer to a union object, suitably converted, points to each of | ||
359 | ** its members [...], and vice versa." | ||
360 | */ | ||
350 | #define cast_u(o) cast(union GCUnion *, (o)) | 361 | #define cast_u(o) cast(union GCUnion *, (o)) |
351 | 362 | ||
352 | /* macros to convert a GCObject into a specific value */ | 363 | /* macros to convert a GCObject into a specific value */ |