summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-12-12 23:07:56 +0100
committerTyge Løvset <[email protected]>2021-12-12 23:07:56 +0100
commite9a2578db22faf4a0994f6f588c70407cfa3a4aa (patch)
tree946f4ca1a3c1a03ece07aaf600179e72754b064d /include
parent657cdc6af3de15c5027858b703f1003841a5bbd0 (diff)
downloadSTC-modified-e9a2578db22faf4a0994f6f588c70407cfa3a4aa.tar.gz
STC-modified-e9a2578db22faf4a0994f6f588c70407cfa3a4aa.zip
Fixed the source of the problem for the ptr_elems.c example bug.
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index e7775b58..70b2ff71 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -77,7 +77,7 @@
# define c_alloc(T) c_malloc(sizeof(T))
# define c_alloc_n(T, n) c_malloc(sizeof(T)*(n))
# define c_make(T) (T)
-# define c_new(T, ...) memcpy(c_alloc(T), (T[]){__VA_ARGS__}, sizeof(T))
+# define c_new(T, ...) (T*)memcpy(c_alloc(T), (T[]){__VA_ARGS__}, sizeof(T))
#else
# include <new>
# define c_alloc(T) static_cast<T*>(c_malloc(sizeof(T)))