forked from bartvdbraak/blender
ImBuf: Fix compilation error with older libpng
Older libpng library does not use const pointer to a memory. The exact version is a bit of a guess here, maybe needs tweaks to it tho.
This commit is contained in:
parent
3a810bfed6
commit
5a19d9d8f3
@ -71,7 +71,14 @@ int imb_is_a_png(const unsigned char *mem)
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
if (mem) ret_val = !png_sig_cmp(mem, 0, 8);
|
||||
if (mem) {
|
||||
#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR == 2)
|
||||
/* Older version of libpng doesn't use const pointer to memory. */
|
||||
ret_val = !png_sig_cmp((png_bytep)mem, 0, 8);
|
||||
#else
|
||||
ret_val = !png_sig_cmp(mem, 0, 8);
|
||||
#endif
|
||||
}
|
||||
return(ret_val);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user