From 58d3eba9873682e6feeba0344b7cba20a3fb63ce Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 12 Oct 2024 20:45:56 +0300 Subject: [PATCH] switch to thunk_gen-1.2 --- fdpp/farptr.hpp | 3 ++- fdpp/makefile | 10 +++++++--- fdpp/meson.build | 2 +- fdpp/parsers/mkasmdefs.sh | 16 ---------------- 4 files changed, 10 insertions(+), 21 deletions(-) delete mode 100755 fdpp/parsers/mkasmdefs.sh diff --git a/fdpp/farptr.hpp b/fdpp/farptr.hpp index 9d5332c3..049dd657 100644 --- a/fdpp/farptr.hpp +++ b/fdpp/farptr.hpp @@ -752,7 +752,8 @@ class SymMembT : public MembBase { #define __ASMREF(f) f.get_ref() #define __ASMADDR(v) __##v.get_addr() #define __ASMCALL(f) AsmCSym f -#define __ASYM(x) x.get_sym() +#define __ASYM(x) __##x.get_sym() +#define __ASYM_L(x) __##x.get_sym() #define ASMREF(t) AsmRef #if CLANG_VER < 14 #define DUMMY_MARK(p, n) \ diff --git a/fdpp/makefile b/fdpp/makefile index 8d84ada0..5bd0ba56 100644 --- a/fdpp/makefile +++ b/fdpp/makefile @@ -158,14 +158,18 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),) $(error thunk_gen not installed) endif else +ifeq ($(filter clean,$(MAKECMDGOALS)),) +$(shell pkg-config --atleast-version=1.2 thunk_gen) +ifneq ($(.SHELLSTATUS),0) +$(error thunk_gen is too old, 1.2 is needed) +endif +endif TFLAGS = -a 2 -p 2 PDHDR = $(SRC)/proto.h +GLOB_ASM = $(SRC)/glob_asm.h include $(TGMK) endif -glob_asmdefs.h: $(SRC)/glob_asm.h - $(srcdir)/parsers/mkasmdefs.sh $< >$@ - INSTALL ?= install install: $(ALL) $(INSTALL) -d $(DESTDIR)$(LIBDIR)/fdpp diff --git a/fdpp/meson.build b/fdpp/meson.build index cb7c70ca..452840b4 100644 --- a/fdpp/meson.build +++ b/fdpp/meson.build @@ -2,10 +2,10 @@ project('libfdpp', ['c', 'cpp'], default_options: ['cpp_std=c++20'], version: '0.1', meson_version: '>= 1.3.0') MF = meson.current_source_dir() / 'parsers/mkfar.sh' -MA = meson.current_source_dir() / 'parsers/mkasmdefs.sh' PD = meson.current_source_dir() / 'parsers/parse_decls.sh' tg = dependency('thunk_gen') TG = tg.get_variable(pkgconfig: 'binary') +MA = tg.get_variable(pkgconfig: 'mkadscript') TGS = tg.get_variable(pkgconfig: 'tgscript') TGM4 = tg.get_variable(pkgconfig: 'm4script') TFLAGS = ['-a', '2', '-p', '2'] diff --git a/fdpp/parsers/mkasmdefs.sh b/fdpp/parsers/mkasmdefs.sh deleted file mode 100755 index 11c163e2..00000000 --- a/fdpp/parsers/mkasmdefs.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -grep "__ASM(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+, (.+)\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_ARR(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+\(.+, (.+), .+\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_ARRI(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+\(.+, (.+)\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_ARRI_F(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+\(.+, (.+)\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_FAR(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+, (.+)\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_NEAR(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+, (.+)\).*/#define \1 __ASYM\(__\1\)/' -grep "__ASM_FUNC(" $1 | grep -v '^/' | grep -v '#define' | \ - sed -E 's/.+\((.+)\).*/#define \1 __ASYM\(__\1\)/'