Mercurial > pub > dyncall > dyncall
view test/callback_suite/make-invoke-macros.lua @ 496:da5232da6270
- test code: rand-sig now spitting out dyncallish sigs (with ')' end delim and rettype at end), purely for consistency
author | Tassilo Philipp |
---|---|
date | Mon, 21 Mar 2022 18:11:38 +0100 |
parents | d8f0e6cecdab |
children |
line wrap: on
line source
require "config" if mode == "ordered" then minargs = 0 end local i for i = minargs, maxargs do local line = "#define F" .. i .. "(ID,R" local argdef = "" local argset = "" if i > 0 then line = line .. "," local j for j = 0, i-1 do if j > 0 then argdef = argdef .. "," argset = argset .. "," end argdef = argdef .. "M" .. j argset = argset .. "M[" .. j .. "].M" .. j end end line = line .. argdef .. ") void ID(void* addr) { Result.R = ((CONFIG_API R(*)(" .. argdef .. "))addr)(" .. argset .. ");}\n" io.write(line) end io.flush()