summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-30 16:40:47 +0200
committerGitHub <[email protected]>2021-09-30 16:40:47 +0200
commit17b5521efa91d4686e6fafe901505937fcde1bc7 (patch)
treebf5f8a3f557027fb9d463c7ca192e02f3b63af73
parentcb6cc689516c1adf2b22860ca62e508a3618e3d8 (diff)
downloadSTC-modified-17b5521efa91d4686e6fafe901505937fcde1bc7.tar.gz
STC-modified-17b5521efa91d4686e6fafe901505937fcde1bc7.zip
Update sptr_ex.c
-rw-r--r--examples/sptr_ex.c17
1 files 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 <stdio.h>
#include <stc/cstr.h>
-#include <stc/forward.h>
-
-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 <stc/csptr.h>
+#define i_tag song
+#include <stc/csptr.h> // 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
+}