summaryrefslogtreecommitdiffstats
path: root/src/fltk-1-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-1-fixes.patch')
-rw-r--r--src/fltk-1-fixes.patch102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/fltk-1-fixes.patch b/src/fltk-1-fixes.patch
new file mode 100644
index 0000000..5268409
--- /dev/null
+++ b/src/fltk-1-fixes.patch
@@ -0,0 +1,102 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From b3ddcfa1b97e4dc570626b9fce010646aa5cff9d Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Sun, 27 Mar 2011 22:48:31 +0200
+Subject: [PATCH 1/2] fix png: http://www.fltk.org/strfiles/2542/libpng-1.5.diff
+
+
+diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx
+index 5c7d5d2..9da2a82 100644
+--- a/src/Fl_PNG_Image.cxx
++++ b/src/Fl_PNG_Image.cxx
+@@ -66,6 +66,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+ png_structp pp; // PNG read pointer
+ png_infop info; // PNG info pointers
+ png_bytep *rows; // PNG row pointers
++ int num_trans = 0; // PNG # of transp. colors
+
+
+ // Open the PNG file...
+@@ -75,7 +76,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+ pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ info = png_create_info_struct(pp);
+
+- if (setjmp(pp->jmpbuf))
++ if (setjmp(png_jmpbuf(pp)))
+ {
+ Fl::warning("PNG file \"%s\" contains errors!\n", png);
+ return;
+@@ -87,27 +88,28 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+ // Get the image dimensions and convert to grayscale or RGB...
+ png_read_info(pp, info);
+
+- if (info->color_type == PNG_COLOR_TYPE_PALETTE)
++ if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE)
+ png_set_expand(pp);
+
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ channels = 3;
+ else
+ channels = 1;
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ png_get_tRNS(pp, info, 0, &num_trans, 0);
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ channels ++;
+
+- w((int)(info->width));
+- h((int)(info->height));
++ w((int)(png_get_image_width(pp, info)));
++ h((int)(png_get_image_height(pp, info)));
+ d(channels);
+
+- if (info->bit_depth < 8)
++ if (png_get_bit_depth(pp, info) < 8)
+ {
+ png_set_packing(pp);
+ png_set_expand(pp);
+ }
+- else if (info->bit_depth == 16)
++ else if (png_get_bit_depth(pp, info) == 16)
+ png_set_strip_16(pp);
+
+ # if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA)
+--
+1.7.4.1
+
+
+From 45b72f8c1af18bc8d98dc2358c01a2257b7074bc Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Sun, 27 Mar 2011 22:50:54 +0200
+Subject: [PATCH 2/2] remove obsolete -mno-cygwin
+
+
+diff --git a/configure.in b/configure.in
+index 739c234..ab8a652 100644
+--- a/configure.in
++++ b/configure.in
+@@ -72,16 +72,6 @@ case $uname in
+ CYGWIN* | MINGW*)
+ # Handle Cygwin option *first*, before all other tests.
+ AC_ARG_ENABLE(cygwin, [ --enable-cygwin use the CygWin libraries [default=no]])
+- if test x$enable_cygwin != xyes; then
+- # NOTE: We can't use ARCHFLAGS for this, since it does not work
+- # with some of the function tests - Cygwin uses a
+- # different C library...
+- CFLAGS="$CFLAGS -mno-cygwin"
+- CPPFLAGS="$CPPFLAGS -mno-cygwin"
+- CXXFLAGS="$CXXFLAGS -mno-cygwin"
+- LDFLAGS="$LDFLAGS -mno-cygwin"
+- DSOFLAGS="$DSOFLAGS -mno-cygwin"
+- fi
+ ;;
+ Darwin*)
+ # Starting with 10.6 (Snow Leopard), OS X does not support
+--
+1.7.4.1
+