diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/ccommon.h | 2 |
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)))
|
