From: LMH Date: Sat, 19 May 2012 20:14:12 +0000 (-1000) Subject: Change to squirrel code to fix gcc 4.7 build errors, patch by Dimstar (bug 933). X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=807eadad509d8ca6c92939b334d5a54ebdf53c96;p=supertux.git Change to squirrel code to fix gcc 4.7 build errors, patch by Dimstar (bug 933). --- diff --git a/external/squirrel/squirrel/sqmem.h b/external/squirrel/squirrel/sqmem.h new file mode 100644 index 000000000..38b219af4 --- /dev/null +++ b/external/squirrel/squirrel/sqmem.h @@ -0,0 +1,8 @@ +/* see copyright notice in squirrel.h */ +#ifndef _SQMEM_H_ +#define _SQMEM_H_ + +void *sq_vm_malloc(SQUnsignedInteger size); +void *sq_vm_realloc(void *p,SQUnsignedInteger oldsize,SQUnsignedInteger size); +void sq_vm_free(void *p,SQUnsignedInteger size); +#endif //_SQMEM_H_ diff --git a/external/squirrel/squirrel/sqstate.h b/external/squirrel/squirrel/sqstate.h index a0b739c3e..cb38fd503 100644 --- a/external/squirrel/squirrel/sqstate.h +++ b/external/squirrel/squirrel/sqstate.h @@ -136,8 +136,4 @@ extern SQObjectPtr _one_; extern SQObjectPtr _minusone_; bool CompileTypemask(SQIntVec &res,const SQChar *typemask); - -void *sq_vm_malloc(SQUnsignedInteger size); -void *sq_vm_realloc(void *p,SQUnsignedInteger oldsize,SQUnsignedInteger size); -void sq_vm_free(void *p,SQUnsignedInteger size); #endif //_SQSTATE_H_ diff --git a/external/squirrel/squirrel/squtils.h b/external/squirrel/squirrel/squtils.h index b6a436e4a..9f25336cd 100644 --- a/external/squirrel/squirrel/squtils.h +++ b/external/squirrel/squirrel/squtils.h @@ -2,6 +2,8 @@ #ifndef _SQUTILS_H_ #define _SQUTILS_H_ +#include "sqmem.h" + #define sq_new(__ptr,__type) {__ptr=(__type *)sq_vm_malloc(sizeof(__type));new (__ptr) __type;} #define sq_delete(__ptr,__type) {__ptr->~__type();sq_vm_free(__ptr,sizeof(__type));} #define SQ_MALLOC(__size) sq_vm_malloc((__size));