diff options
| author | Tyge Løvset <[email protected]> | 2021-12-12 23:07:56 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-12 23:07:56 +0100 |
| commit | e9a2578db22faf4a0994f6f588c70407cfa3a4aa (patch) | |
| tree | 946f4ca1a3c1a03ece07aaf600179e72754b064d /include | |
| parent | 657cdc6af3de15c5027858b703f1003841a5bbd0 (diff) | |
| download | STC-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.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)))
|
