summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-02 10:29:40 +0200
committerTyge Løvset <[email protected]>2021-10-02 10:29:40 +0200
commit09a07970445dc34b986b1836679616ab8de81792 (patch)
tree9f12eaf0429f23440a8a09a8be363f1470bea6ba
parentaa3d4033ebc9cf86e752d1ecc9f3e9e41b371865 (diff)
parent17b5521efa91d4686e6fafe901505937fcde1bc7 (diff)
downloadSTC-modified-09a07970445dc34b986b1836679616ab8de81792.tar.gz
STC-modified-09a07970445dc34b986b1836679616ab8de81792.zip
Merge branch 'master' of github.com:tylov/STC into master
-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
+}