From 13942348e08e1b68fa439a5fabf8baf108466bb0 Mon Sep 17 00:00:00 2001 From: Tim Wright Date: Tue, 18 Apr 2017 19:54:57 -0600 Subject: [PATCH] Fixing void * compile error for C++ --- stretchy_buffer.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stretchy_buffer.h b/stretchy_buffer.h index bb711f6..bc11083 100644 --- a/stretchy_buffer.h +++ b/stretchy_buffer.h @@ -162,6 +162,10 @@ // the main trick is in realizing in the first place that it's // possible to do this in a generic, type-safe way in C. // +// Contributors: +// +// Timothy Wright (github:ZenToad) +// // LICENSE // // See end of file for license information. @@ -189,7 +193,7 @@ #define stb__sbneedgrow(a,n) ((a)==0 || stb__sbn(a)+(n) >= stb__sbm(a)) #define stb__sbmaybegrow(a,n) (stb__sbneedgrow(a,(n)) ? stb__sbgrow(a,n) : 0) -#define stb__sbgrow(a,n) ((a) = stb__sbgrowf((a), (n), sizeof(*(a)))) +#define stb__sbgrow(a,n) (*((void **)&(a)) = stb__sbgrowf((a), (n), sizeof(*(a)))) #include