AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.12.11 12:44 "[Tiff] [PATCH] LynxOS compile fixes", by Olli Savia
2005.12.12 09:21 "Re: [Tiff] [PATCH] LynxOS compile fixes", by Andrey Kiselev
2005.12.13 21:11 "RE: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Frank, Jason
2005.12.13 19:53 "RE: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Frank, Jason
2005.12.12 21:32 "[Tiff] Bug in tiffcp (unsupported codecs return 0)", by Frank, Jason
2005.12.14 02:34 "RE: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Frank, Jason
2005.12.13 20:09 "Re: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Andrey Kiselev
2005.12.13 21:46 "Re: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Andrey Kiselev
2005.12.13 23:32 "Re: [Tiff] Bug in tiffcp (unsupported codecs return 0)", by Edward Lam

2005.12.11 12:44 "[Tiff] [PATCH] LynxOS compile fixes", by Olli Savia

Hi

This patch fixes compile errors on LynxOS. It is
generated against tiff-3.7.4.

A short description of modifications:

tif_fax3.{h,c}: Replaced macro SETVAL with macro SETVALUE to avoid macro conflict. SETVAL is defined in LynxOS system header files.

tif_unix.c: Added include <stdarg.h> and <sys/types.h> when compiling on LynxOS.

Could you consider applying these changes to tiff package?

Thanks,
Olli

diff -urN tiff-3.7.4.orig/libtiff/tif_fax3.c tiff-3.7.4/libtiff/tif_fax3.c
--- tiff-3.7.4.orig/libtiff/tif_fax3.c Fri Jul 29 14:21:10 2005
+++ tiff-3.7.4/libtiff/tif_fax3.c Sun Dec 11 15:14:04 2005
@@ -286,7 +286,7 @@
                else
                        EXPAND2D(EOF2Da);
                (*sp->fill)(buf, thisrun, pa, lastx);

-               SETVAL(0);              /* imaginary change for reference */
+               SETVALUE(0);            /* imaginary change for reference */

                SWAP(uint32*, sp->curruns, sp->refruns);
                buf += sp->b.rowbytes;
                occ -= sp->b.rowbytes;

@@ -1375,7 +1375,7 @@
                 if (EOLcnt)
                     goto EOFG4;
                (*sp->fill)(buf, thisrun, pa, lastx);

-               SETVAL(0);              /* imaginary change for reference */
+               SETVALUE(0);            /* imaginary change for reference */

                SWAP(uint32*, sp->curruns, sp->refruns);
                buf += sp->b.rowbytes;
                occ -= sp->b.rowbytes;

diff -urN tiff-3.7.4.orig/libtiff/tif_fax3.h tiff-3.7.4/libtiff/tif_fax3.h
--- tiff-3.7.4.orig/libtiff/tif_fax3.h Fri Dec 1 17:46:46 2000
+++ tiff-3.7.4/libtiff/tif_fax3.h Sun Dec 11 15:13:59 2005
@@ -217,9 +217,9 @@
     ClrBits(TabEnt->Width); \
 } while (0)

-#define SETVAL(x) do { \
+#define SETVALUE(x) do { \

     *pa++ = RunLength + (x);                                           \
-    printf("SETVAL: %d\t%d\n", RunLength + (x), a0);                   \
+    printf("SETVALUE: %d\t%d\n", RunLength + (x), a0);                 \
     a0 += x;                                                           \
     RunLength = 0;                                                     \

 } while (0)
@@ -239,7 +239,7 @@
  * Append a run to the run length array for the
  * current row and reset decoding state.
  */
-#define SETVAL(x) do { \
+#define SETVALUE(x) do { \

     *pa++ = RunLength + (x);                                           \
     a0 += (x);                                                         \
     RunLength = 0;                                                     \

@@ -284,7 +284,7 @@
  */

 #define        CLEANUP_RUNS() do {                                             \

     if (RunLength)                                                     \
-       SETVAL(0);                                                      \
+       SETVALUE(0);                                                    \
     if (a0 != lastx) {                                                 \
        badlength(a0, lastx);                                           \
        while (a0 > lastx && pa > thisrun)                              \
@@ -293,11 +293,11 @@
            if (a0 < 0)                                                 \
                a0 = 0;                                                 \
            if ((pa-thisrun)&1)                                         \
-               SETVAL(0);                                              \
-           SETVAL(lastx - a0);                                         \
+               SETVALUE(0);                                            \
+           SETVALUE(lastx - a0);                                               \
        } else if (a0 > lastx) {                                        \
-           SETVAL(lastx);                                              \
-           SETVAL(0);                                                  \
+           SETVALUE(lastx);                                            \
+           SETVALUE(0);                                                        \
        }                                                               \
     }                                                                  \
 } while (0)
@@ -323,7 +323,7 @@
                EOLcnt = 1;                                             \
                goto done1d;                                            \
            case S_TermW:                                               \
-               SETVAL(TabEnt->Param);                                  \
+               SETVALUE(TabEnt->Param);                                        \
                goto doneWhite1d;                                       \
            case S_MakeUpW:                                             \
            case S_MakeUp:                                              \
@@ -345,7 +345,7 @@
                EOLcnt = 1;                                             \
                goto done1d;                                            \
            case S_TermB:                                               \
-               SETVAL(TabEnt->Param);                                  \
+               SETVALUE(TabEnt->Param);                                        \
                goto doneBlack1d;                                       \
            case S_MakeUpB:                                             \
            case S_MakeUp:                                              \
@@ -402,7 +402,7 @@
                    LOOKUP16(13, TIFFFaxBlackTable, eof2d);             \
                    switch (TabEnt->State) {                            \
                    case S_TermB:                                       \
-                       SETVAL(TabEnt->Param);                          \
+                       SETVALUE(TabEnt->Param);                                \
                        goto doneWhite2da;                              \
                    case S_MakeUpB:                                     \
                    case S_MakeUp:                                      \
@@ -418,7 +418,7 @@
                    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);             \
                    switch (TabEnt->State) {                            \
                    case S_TermW:                                       \
-                       SETVAL(TabEnt->Param);                          \
+                       SETVALUE(TabEnt->Param);                                \
                        goto doneBlack2da;                              \
                    case S_MakeUpW:                                     \
                    case S_MakeUp:                                      \
@@ -435,7 +435,7 @@
                    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);             \
                    switch (TabEnt->State) {                            \
                    case S_TermW:                                       \
-                       SETVAL(TabEnt->Param);                          \
+                       SETVALUE(TabEnt->Param);                                \
                        goto doneWhite2db;                              \
                    case S_MakeUpW:                                     \
                    case S_MakeUp:                                      \
@@ -451,7 +451,7 @@
                    LOOKUP16(13, TIFFFaxBlackTable, eof2d);             \
                    switch (TabEnt->State) {                            \
                    case S_TermB:                                       \
-                       SETVAL(TabEnt->Param);                          \
+                       SETVALUE(TabEnt->Param);                                \
                        goto doneBlack2db;                              \
                    case S_MakeUpB:                                     \
                    case S_MakeUp:                                      \
@@ -468,17 +468,17 @@
            break;                                                      \
        case S_V0:                                                      \
            CHECK_b1;                                                   \
-           SETVAL(b1 - a0);                                            \
+           SETVALUE(b1 - a0);                                          \
            b1 += *pb++;                                                \
            break;                                                      \
        case S_VR:                                                      \
            CHECK_b1;                                                   \
-           SETVAL(b1 - a0 + TabEnt->Param);                            \
+           SETVALUE(b1 - a0 + TabEnt->Param);                          \
            b1 += *pb++;                                                \
            break;                                                      \
        case S_VL:                                                      \
            CHECK_b1;                                                   \
-           SETVAL(b1 - a0 - TabEnt->Param);                            \
+           SETVALUE(b1 - a0 - TabEnt->Param);                          \
            b1 -= *--pb;                                                \
            break;                                                      \
        case S_Ext:                                                     \
@@ -517,7 +517,7 @@
                goto badMain2d;                                         \
            ClrBits(1);                                                 \
        }                                                               \
-       SETVAL(0);                                                      \
+       SETVALUE(0);                                                    \
     }                                                                  \
 eol2d:                                                                 \
     CLEANUP_RUNS();                                                    \
diff -urN tiff-3.7.4.orig/libtiff/tif_unix.c tiff-3.7.4/libtiff/tif_unix.c
--- tiff-3.7.4.orig/libtiff/tif_unix.c  Tue Jul 12 15:49:10 2005
+++ tiff-3.7.4/libtiff/tif_unix.c       Sun Dec 11 15:13:03 2005

@@ -30,6 +30,11 @@
  */
 #include "tif_config.h"

+#ifdef __Lynx__
+#include <stdarg.h>
+#include <sys/types.h>
+#endif
+
 #include <stdlib.h>
 #include <sys/stat.h>