blob: 8cfbb94893c735b07abc7945d073c3f835d82725 [file] [log] [blame] [edit]
diff --git a/m4/devil-definitions.m4 b/m4/devil-definitions.m4
--- a/m4/devil-definitions.m4
+++ b/m4/devil-definitions.m4
@@ -273,15 +273,19 @@ AC_DEFUN([TEST_API],
[enable_$1="yes"]) ])
dnl Test for restrict c/c++ keyword
+dnl TODO(binji): Turn back on restrict. On clang, this fails below because it
+dnl adds --std=gnu99 to CFLAGS. This works fine with clang, but clang++
+dnl complains that the flag is incompatible. g++ doesn't seem to mind, however.
AC_DEFUN([DEVIL_CHECK_RESTRICT],
[AC_MSG_CHECKING([restrict keyword])
- AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
- [AC_DEFINE([RESTRICT_KEYWORD],
- [],
- [restric keyword available])
- restrict_keyword="found"
- AC_MSG_RESULT([yes]) ],
- [AC_MSG_RESULT([no]) ]) ])
+ AC_MSG_RESULT([no])])
+dnl AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
+dnl [AC_DEFINE([RESTRICT_KEYWORD],
+dnl [],
+dnl [restric keyword available])
+dnl restrict_keyword="found"
+dnl AC_MSG_RESULT([yes]) ],
+dnl [AC_MSG_RESULT([no]) ]) ])
AC_DEFUN([DEVIL_CHECK_RESTRICT_GNU99],
[TMP_CFLAGS="$CFLAGS"
diff --git a/src-IL/include/il_endian.h b/src-IL/include/il_endian.h
--- a/src-IL/include/il_endian.h
+++ b/src-IL/include/il_endian.h
@@ -40,7 +40,7 @@
#else
#undef __BIG_ENDIAN__
#undef __LITTLE_ENDIAN__ // Not sure if it's defined by any compiler...
- #define __LITTLE_ENDIAN__
+ #define __LITTLE_ENDIAN__ 1
#define Short(s)
#define UShort(s)
#define Int(i)
diff --git a/src-IL/src/il_alloc.c b/src-IL/src/il_alloc.c
--- a/src-IL/src/il_alloc.c
+++ b/src-IL/src/il_alloc.c
@@ -123,6 +123,7 @@ static void ILAPIENTRY DefaultFreeFunc(const void * CONST_RESTRICT ptr)
{
if (ptr)
{
+#ifdef VECTORMEM
#ifdef MM_MALLOC
_mm_free((void*)ptr);
#else
@@ -132,6 +133,9 @@ static void ILAPIENTRY DefaultFreeFunc(const void * CONST_RESTRICT ptr)
free((void*)ptr);
#endif //OTHERS...
#endif //MM_MALLOC
+#else //VECTORMEM
+ free((void*)ptr);
+#endif
}
}
diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c
--- a/src-IL/src/il_icon.c
+++ b/src-IL/src/il_icon.c
@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent)
// Expand low-bit-depth grayscale images to 8 bits
if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(ico_png_ptr);
+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
}
// Expand RGB images with transparency to full alpha channels
diff --git a/src-IL/src/il_internal.c b/src-IL/src/il_internal.c
--- a/src-IL/src/il_internal.c
+++ b/src-IL/src/il_internal.c
@@ -21,7 +21,12 @@ ILimage *iCurImage = NULL;
/* Siigron: added this for Linux... a #define should work, but for some reason
it doesn't (anyone who knows why?) */
-#if !_WIN32 || (_WIN32 && __GNUC__) // Cygwin
+#if defined(__native_client__) && defined(__GLIBC__)
+ #define stricmp strcasecmp
+ #define strnicmp strncasecmp
+#elif defined(__native_client__) && !defined(__GLIBC__)
+ // Already defined in string.h
+#elif !_WIN32 || (_WIN32 && __GNUC__) // Cygwin
int stricmp(const char *src1, const char *src2)
{
return strcasecmp(src1, src2);
diff --git a/src-IL/src/il_png.c b/src-IL/src/il_png.c
--- a/src-IL/src/il_png.c
+++ b/src-IL/src/il_png.c
@@ -278,7 +278,7 @@ ILboolean readpng_get_image(ILdouble display_exponent)
// Expand low-bit-depth grayscale images to 8 bits
if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_gray_1_2_4_to_8(png_ptr);
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
}
// Expand RGB images with transparency to full alpha channels
diff --git a/test/format_test/format_checks.sh.in b/test/format_test/format_checks.sh.in
--- a/test/format_test/format_checks.sh.in
+++ b/test/format_test/format_checks.sh.in
@@ -30,9 +30,9 @@ do
then # This extension is not considered as supported...
continue;
fi
- test -n "$VERBOSE" && echo $WINE ./testil@EXEEXT@ -e $EXTENSION
+ test -n "$VERBOSE" && echo $WINE ./testil.sh -e $EXTENSION
# EXEEXT comes in when one compiles on platforms that append extensions to executables (testil.exe)
- $WINE ./testil@EXEEXT@ -e$VERBOSE $EXTENSION
+ $WINE ./testil.sh -e$VERBOSE $EXTENSION
# We have to capture whether the test has failed or not
if [ ! $? -eq 0 ]