view test/callback_suite/make-invoke-macros.lua @ 410:7608e34098b0

- cleanups, simplifications, some api clarification, ... - test cases consistency: * return status code depending on test results (for actual conformance tests, not stuff that is not an example or hack to check something, ..) * platform init helper added for some
author Tassilo Philipp
date Tue, 05 Oct 2021 21:53:04 +0200
parents 3e629dc19168
children d8f0e6cecdab
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 .. "A" .. j
      argset = argset .. "A[" .. j .. "].A" .. 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()