From 7fd1e1df81c3ed45e176f1bbf46d873b6cff316e Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 12 Nov 2011 13:00:29 +0000 Subject: (svn r23198) -Codechange: introduce a free that takes const pointers so we don't need to cast to void/non-const before being able to free --- src/stdafx.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/stdafx.h') diff --git a/src/stdafx.h b/src/stdafx.h index bee855169..7120ec175 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -437,6 +437,15 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2); #define MAX_PATH 260 #endif +/** + * Version of the standard free that accepts const pointers. + * @param ptr The data to free. + */ +static FORCEINLINE void free(const void *ptr) +{ + free(const_cast(ptr)); +} + /** * The largest value that can be entered in a variable * @param type the type of the variable -- cgit v1.2.3-54-g00ecf