From 4f3d9275f84e810f573e8cbef8c1c6630bae3861 Mon Sep 17 00:00:00 2001 From: jmgomez Date: Wed, 12 Jul 2023 19:04:23 +0100 Subject: [PATCH] changes the test so `echo` is not used before Nim is init --- tests/cpp/tmember.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/cpp/tmember.nim b/tests/cpp/tmember.nim index 65ba7d70d6fa..b0f630a9209a 100644 --- a/tests/cpp/tmember.nim +++ b/tests/cpp/tmember.nim @@ -8,6 +8,7 @@ destructing destructing ''' """ +proc print(s: cstring) {.importcpp:"printf(@)", header:"".} type Foo {.exportc.} = object @@ -16,8 +17,8 @@ type proc memberProc(f: Foo) {.exportc, member.} = echo $f.test -proc destructor(f: Foo) {.member: "~'1()".} = - echo "destructing" +proc destructor(f: Foo) {.member: "~'1()", used.} = + print "destructing\n" proc `==`(self, other: Foo): bool {.member:"operator==('2 const & #2) const -> '0"} = self.test == other.test