Imported from libpng-1.4.0beta32.tar
diff --git a/pngwrite.c b/pngwrite.c
index 70774fc..9123bda 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -399,7 +399,9 @@
     * experiences this problem, please report the event to
     * png-mng-implement at lists.sf.net .
     */
+#if defined(PNG_WRITE_FLUSH_SUPPORTED)
    png_flush(png_ptr);
+#endif
 }
 
 #if defined(PNG_WRITE_tIME_SUPPORTED)