diff options
| author | Tyge Løvset <[email protected]> | 2021-09-21 20:49:22 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-09-21 20:49:22 +0200 |
| commit | fbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b (patch) | |
| tree | 31dea2b7af4298d211b99e50b903be5f39ddebfb /examples | |
| parent | 32a3454eb463f86d7ace7b29c2e1574530499afc (diff) | |
| download | STC-modified-fbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b.tar.gz STC-modified-fbfb57d46e4d042c2c5ae1c5a56dad00660d3e3b.zip | |
Added copy(self, other) function to all containers. Fixed some docs.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/runall.sh | 14 | ||||
| -rw-r--r-- | examples/sharedptr.c | 1 |
2 files changed, 10 insertions, 5 deletions
diff --git a/examples/runall.sh b/examples/runall.sh index 71b1c383..cec626a6 100644 --- a/examples/runall.sh +++ b/examples/runall.sh @@ -1,11 +1,15 @@ -#!/bin/sh +#!/bin/bash cc='gcc -std=c99 -pedantic' #cc='clang' #cc='clang -c -DSTC_HEADER' #cc='cl -nologo' #cc='cl -nologo -TP' #cc='cl -nologo -std:c11' +libs='' run=0 +if [ -z "$OS" ]; then + libs='-lm' +fi if [ "$1" == '-h' -o "$1" == '--help' ]; then echo usage: runall.sh [-run] [compiler + options] exit @@ -19,13 +23,13 @@ if [ ! -z "$1" ] ; then fi if [ $run = 0 ] ; then for i in *.c ; do - echo $cc -I../include $i - $cc -I../include $i + echo $cc -I../include $i $libs + $cc -I../include $i $libs done else for i in *.c ; do - echo $cc -I../include $i - $cc -I../include $i + echo $cc -I../include $i $libs + $cc -I../include $i $libs if [ -f $(basename -s .c $i).exe ]; then ./$(basename -s .c $i).exe; fi if [ -f ./a.exe ]; then ./a.exe; fi if [ -f ./a.out ]; then ./a.out; fi diff --git a/examples/sharedptr.c b/examples/sharedptr.c index 4d28e1c1..f1861929 100644 --- a/examples/sharedptr.c +++ b/examples/sharedptr.c @@ -6,6 +6,7 @@ void int_del(int* x) { #define i_val int
#define i_valdel int_del // optional func to show elements destroyed
+#define i_nonatomic // only for single thread; faster.
#include <stc/csptr.h> // define csptr_int shared pointers
#define i_key_csptr int // refer to csptr_int definition above
|
