Fix warning about context parameter being unused when STBIR_MALLOC and STBIR_FREE have their default definitions.

This commit is contained in:
Nathan Reed 2017-05-11 22:51:19 -07:00
parent 76a1a1c408
commit fb524e6768
1 changed files with 3 additions and 2 deletions

View File

@ -393,8 +393,9 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int
#ifndef STBIR_MALLOC
#include <stdlib.h>
#define STBIR_MALLOC(size,c) malloc(size)
#define STBIR_FREE(ptr,c) free(ptr)
// use comma operator to evaluate c, to avoid "unused parameter" warnings
#define STBIR_MALLOC(size,c) ((void)(c), malloc(size))
#define STBIR_FREE(ptr,c) ((void)(c), free(ptr))
#endif
#ifndef _MSC_VER