Successfully defining png_int_16 in pngconf.h
Michael Enright <[email protected]> Thu, 14 Feb 2019 17:51:37 -0800
| Newsgroups | gmane.comp.graphics.png.devel |
|---|---|
| Message-ID | <CAOC2fq9YPOu37Z=ooBZmB+cAbhWt=wbAEB9wsDMRdW016MX_KQ@mail.gmail.com> |
I'm working with libpng and I am required to use it within a kernel module. The problem is that pngconf.h tries to determine how to define a 16-bit signed type by comparing preprocessor symbols to values like this: #if INT_MIN == -32768 && INT_MAX == 32767 /* Our 16-bit signed type is 'int', define stuff accordingly */ #endif In linux/kernel.h INT_MAX is defined as ((int)((~0U>>1)) Thus the conditional involves the token 'int' which to the preprocessor is just another symbol and the cast is just bad syntax (to the preprocessor). Does anyone have a suggestion for how to get pngconf.h to successfully compile?