summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-11-08 08:06:55 +0100
committerTyge Løvset <[email protected]>2021-11-08 08:06:55 +0100
commitc8278d5437ac51ce1d63327fee6296035d80fe20 (patch)
tree787820e443f78e5b9d4a95e558963d8eab5c46b0 /include
parente591f7c15e55eebc2f761808f5a773e42eb6638d (diff)
downloadSTC-modified-c8278d5437ac51ce1d63327fee6296035d80fe20.tar.gz
STC-modified-c8278d5437ac51ce1d63327fee6296035d80fe20.zip
Third trial.
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index 06ccfc04..9359414c 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -77,13 +77,13 @@
# define c_new(T) c_malloc(sizeof(T))
# define c_new_n(T, n) c_malloc(sizeof(T)*(n))
# define c_make(T) (T)
-# define c_make_ptr(T, value) memcpy(c_new(T), &(T){value}, sizeof(T))
+# define c_make_ptr(T, ...) memcpy(c_new(T), (T[]){__VA_ARGS__}, sizeof(T))
#else
# include <new>
# define c_new(T) static_cast<T*>(c_malloc(sizeof(T)))
# define c_new_n(T, n) static_cast<T*>(c_malloc(sizeof(T)*(n)))
# define c_make(T) T
-# define c_make_ptr(T, value) new (c_new(T)) T{value}
+# define c_make_ptr(T, ...) new (c_new(T)) T{__VA_ARGS__}
#endif
#ifndef c_malloc
# define c_malloc(sz) malloc(sz)