[BACK]Return to patch-av CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / graphics / urt / patches

File: [cvs.NetBSD.org] / pkgsrc / graphics / urt / patches / patch-av (download)

Revision 1.2, Sun Jun 29 04:26:19 2014 UTC (7 years, 3 months ago) by dholland
Branch: MAIN
Changes since 1.1: +5 -3 lines

Extend dfly patch to macos: stdout is not necessarily a compile-time
constant.

$NetBSD: patch-av,v 1.2 2014/06/29 04:26:19 dholland Exp $

stdout is not necessarily a compile-time constant.

--- lib/rle_global.c.orig	1992-01-28 18:23:03.000000000 +0000
+++ lib/rle_global.c
@@ -76,7 +76,11 @@ rle_hdr rle_dflt_hdr = {
     8,				/* cmaplen (log2 of length of color map) */
     NULL,			/* pointer to color map */
     NULL,			/* pointer to comment strings */
+#if defined(__DragonFly__) || defined(__APPLE__)
+    NULL,			/* output file, overriden with stdout at startup */
+#else
     stdout,			/* output file */
+#endif
     { 7 },			/* RGB channels only */
     0L,				/* Can't free name and file fields. */
     "Urt",			/* Default "program name". */
@@ -85,6 +89,16 @@ rle_hdr rle_dflt_hdr = {
     /* Can't initialize the union */
 };
 
+#if defined(__DragonFly__) || defined(__APPLE__)
+static void _rle_init(void) __attribute__((__constructor__));
+
+static void
+_rle_init(void)
+{
+    rle_dflt_hdr.rle_file = stdout;
+}
+#endif
+
 /* ARGSUSED */
 void
 NullputEof(the_hdr)