From 8b23662d5313718cfd90759c766d02b082af4adf Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 11 Dec 2019 17:57:43 +0100 Subject: [PATCH] Fix libtcc_test_mt with lib64 we need to pass NATIVE_DEFINES, and we need to actually parse and pass them into the state. --- tests/Makefile | 2 +- tests/libtcc_test_mt.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 85657bde..9fe213e9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -77,7 +77,7 @@ hello-run: ../examples/ex1.c libtes%: libtcc_tes%$(EXESUF) @echo ------------ $@ ------------ - ./libtcc_tes$*$(EXESUF) $(TCCFLAGS) + ./libtcc_tes$*$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) libtcc_tes%$(EXESUF): libtcc_tes%.c $(LIBTCC) $(CC) -o $@ $^ $(CFLAGS) $(LIBS) diff --git a/tests/libtcc_test_mt.c b/tests/libtcc_test_mt.c index cebdec36..56294e4c 100644 --- a/tests/libtcc_test_mt.c +++ b/tests/libtcc_test_mt.c @@ -102,6 +102,14 @@ void parse_args(TCCState *s) tcc_add_include_path(s, a+2); else if (a[1] == 'L') tcc_add_library_path(s, a+2); + else if (a[1] == 'D') { + char *eq = strchr(a+2, '='); + if (eq) { + *eq = 0; + tcc_define_symbol(s, a+2, eq+1); + *eq = '='; + } + } } } }