Mercurial > pub > dyncall > dyncall
view test/callback_suite/make-invoke-macros.lua @ 217:87c695673522
dynload darwin/mach-o update:
- removed unnecessarily complex darwin loader interface, and sharing with dynload_unix now
- mach-o symbol resolving refactored:
* to handle symlinks, relative paths, paths with random casing
* loading lib when not already loaded, for API consistency with ELF and PE implementations
author | Tassilo Philipp |
---|---|
date | Thu, 06 Apr 2017 12:00:36 +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()