(base_dir, os_name, target_arch, target)
| 85 | |
| 86 | |
| 87 | def render_ffi_header(base_dir, os_name, target_arch, target): |
| 88 | template = (base_dir / 'include' / 'ffi.h.in').read_text(encoding='utf-8') |
| 89 | replacements = { |
| 90 | '@FFI_EXEC_TRAMPOLINE_TABLE@': |
| 91 | '1' if uses_exec_trampoline_table(os_name, target_arch) else '0', |
| 92 | '@FFI_VERSION_NUMBER@': LIBFFI_VERSION_NUMBER, |
| 93 | '@FFI_VERSION_STRING@': LIBFFI_VERSION, |
| 94 | '@HAVE_LONG_DOUBLE@': has_long_double(os_name, target_arch), |
| 95 | '@TARGET@': target, |
| 96 | '@VERSION@': LIBFFI_VERSION, |
| 97 | } |
| 98 | |
| 99 | for source, replacement in replacements.items(): |
| 100 | template = template.replace(source, replacement) |
| 101 | |
| 102 | return template |
| 103 | |
| 104 | |
| 105 | def render_fficonfig(os_name, target_arch): |
no test coverage detected