summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-04-24 18:29:06 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-04-24 18:29:06 +0000
commit7b99f66d03c60cfd8b46e3350420ef07d1fdcc9c (patch)
tree6eca8e182be22dcb72e57754865c0a8be347a7b4 /src
parentf87f7a7b1491efaeb52128b393e73c3a2ca4f733 (diff)
Add check for libpng/png.h as well as png.h, and include the appropriate
one as needed... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_PNG_Image.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx
index 8053755d6..99a0537ea 100644
--- a/src/Fl_PNG_Image.cxx
+++ b/src/Fl_PNG_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_PNG_Image.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $"
+// "$Id: Fl_PNG_Image.cxx,v 1.1.2.5 2002/04/24 18:29:05 easysw Exp $"
//
// Fl_PNG_Image routines.
//
@@ -39,10 +39,14 @@
extern "C"
{
-#ifdef HAVE_LIBPNG
+#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ)
# include <zlib.h>
-# include <png.h>
-#endif // HAVE_LIBPNG
+# ifdef HAVE_PNG_H
+# include <png.h>
+# else
+# include <libpng/png.h>
+# endif // HAVE_PNG_H
+#endif // HAVE_LIBPNG ** HAVE_LIBZ
}
@@ -52,7 +56,7 @@ extern "C"
Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
: Fl_RGB_Image(0,0,0) {
-#ifdef HAVE_LIBPNG
+#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ)
int i; // Looping var
FILE *fp; // File pointer
int channels; // Number of color channels
@@ -97,11 +101,11 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
else if (info->bit_depth == 16)
png_set_strip_16(pp);
-#if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA)
+# if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA)
// Handle transparency...
if (png_get_valid(pp, info, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(pp);
-#endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA
+# endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA
array = new uchar[w() * h() * d()];
@@ -126,10 +130,10 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
# endif // HAVE_PNG_READ_DESTROY
fclose(fp);
-#endif // HAVE_LIBPNG
+#endif // HAVE_LIBPNG && HAVE_LIBZ
}
//
-// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $".
+// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.5 2002/04/24 18:29:05 easysw Exp $".
//