From 17b5521efa91d4686e6fafe901505937fcde1bc7 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Thu, 30 Sep 2021 16:40:47 +0200 Subject: Update sptr_ex.c --- examples/sptr_ex.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/examples/sptr_ex.c b/examples/sptr_ex.c index d7b3999b..85d6c34d 100644 --- a/examples/sptr_ex.c +++ b/examples/sptr_ex.c @@ -1,17 +1,7 @@ // shared_ptr-examples.cpp // based on https://docs.microsoft.com/en-us/cpp/cpp/how-to-create-and-use-shared-ptr-instances?view=msvc-160 -#include #include -#include - -forward_csptr(csptr_song, struct Song); -struct Test { - csptr_song song1; - csptr_song song2; -}; - -// ... struct Song { @@ -27,12 +17,11 @@ void Song_del(Song* s) { c_del(cstr, &s->artist, &s->title); } -#define i_fwd -#define i_tag song #define i_val Song #define i_cmp c_no_compare #define i_del Song_del -#include +#define i_tag song +#include // define csptr_song #define i_val_csptr csptr_song #define i_tag song @@ -66,4 +55,4 @@ void example3() int main() { example3(); -} \ No newline at end of file +} -- cgit v1.2.3