Skip to content

Commit

Permalink
thunk_gen: add _L_SZ macro for ptr convs
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Feb 8, 2024
1 parent 909842d commit f2731df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fdpp/thunk_gen/thunk_gen.y
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ static void do_start_arg(int anum)
arg_num + 1, arr_sz);
break;
case CVTYPE_OTHER:
strcat(abuf, "_CNV_PTR, _L_NONE");
sprintf(abuf + strlen(abuf), "_CNV_PTR, _L_SZ(%i)",
arg_num + 1);
break;
}
break;
Expand Down
3 changes: 2 additions & 1 deletion fdpp/thunks_p.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#define __CNV_PTR_FAR(t, d, f, l, t0) t d = (f)
#define __CNV_PTR(t, d, f, l, t0) \
_MK_FAR_SZ(__##d, f, sizeof(*f)); \
_MK_FAR_SZ(__##d, f, l); \
t d = __MK_NEAR2(__##d, t)
#define __CNV_PTR_CCHAR(t, d, f, l, t0) \
_MK_FAR_STR(__##d, f); \
Expand All @@ -51,5 +51,6 @@
#define _CNV(c, t, at, l, n) c(at, _a##n, a##n, l, t)
#define _L_REF(nl) a##nl
#define _L_IMM(n, l) (sizeof(*_L_REF(n)) * (l))
#define _L_SZ(n) sizeof(*_L_REF(n))

#include <thunk_asms.h>

0 comments on commit f2731df

Please sign in to comment.