Open mingodad opened 9 months ago
I believe the snippet is using the C compound literals e.g. stuff like auto v = (int[2]){1,2};
or (struct point){10,20}
. They are standard in C but not in C++. It is yet another gcc/clang extension, I will make sure to add support for it, thanks for the report.
If you do so maybe also add the offsetof
macro/builtin with it Lua
can be parsed defining -DLUA_USE_JUMPTABLE=0
because although cxx
somehow has defined macros that identify it as gcc
compatible it doesn't accept it:
/*
** By default, use jump tables in the main interpreter loop on gcc
** and compatible compilers.
*/
#if !defined(LUA_USE_JUMPTABLE)
#if defined(__GNUC__)
#define LUA_USE_JUMPTABLE 1
#else
#define LUA_USE_JUMPTABLE 0
#endif
#endif
...
tatic const void *const disptab[NUM_OPCODES] = {
&&L_OP_MOVE,
&&L_OP_LOADI,
&&L_OP_LOADF,
...
sqlite3 has this:
#ifndef __builtin_offsetof
#define __builtin_offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
#endif
While testing
cxx
with https://c9x.me/qscm/data/qscm.c I found thatcxx
get lost with this extracted test (heavy on macros):