Fix support of posix_memalign for Linux
[openjpeg.git] / src / lib / openjp2 / opj_config_private.h.cmake.in
index b05822c3ca0a6cb1225e703f5a153e2e9dcfc768..c41f9066242d7318b89beab7a33132007cfff3fc 100644 (file)
 /* check if function `posix_memalign` exists */
 #cmakedefine OPJ_HAVE_POSIX_MEMALIGN
 
+#if !defined(_POSIX_C_SOURCE)
+#if defined(OPJ_HAVE_FSEEKO) || defined(OPJ_HAVE_POSIX_MEMALIGN)
+/* Get declarations of fseeko, ftello, posix_memalign. */
+#define _POSIX_C_SOURCE 200112L
+#endif
+#endif
+
 /* Byte order.  */
 /* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
 __LITTLE_ENDIAN__ to match the endianness of the architecture being