2003.08.11 15:14 "[Tiff] A couple more patches", by Tom Kacvinsky

2003.08.11 15:14 "[Tiff] A couple more patches", by Tom Kacvinsky

On the Solaris boxes I compile on, I always get a warning about an unprototyped function (strcpy) when tiff2ps is being compiled. That is because strcpy is defined in strings.h and strings.h is not used in tiff2ps.c. This is what I did to get around the issue (at least for tiff2ps):

Add a check for stings.h (see patch for configure).

Make tiff2ps.c use port.h (see patch for tiff2ps).

As we are a Solaris shop, I have not been able to test this on other types of Unices, so I am not sure if this is portable or not.

Let me know what you think...

Regards,

Tom

Index: tiff2ps.c
===================================================================
RCS file: /cvsroot/osrs/libtiff/tools/tiff2ps.c,v
retrieving revision 1.17
diff -u -r1.17 tiff2ps.c
--- tiff2ps.c       7 May 2003 08:12:30 -0000       1.17
+++ tiff2ps.c       11 Aug 2003 14:59:21 -0000
@@ -24,11 +24,7 @@
  * OF THIS SOFTWARE.
  */

-#include <stdio.h>
-#include <stdlib.h>                   /* for atof */
-#include <math.h>
-#include <time.h>
-
+#include "port.h"
 #include "tiffio.h"


Index: configure
===================================================================
RCS file: /cvsroot/osrs/libtiff/configure,v
retrieving revision 1.30
diff -u -r1.30 configure
--- configure   20 May 2003 15:42:10 -0000      1.30
+++ configure       11 Aug 2003 14:58:58 -0000
@@ -1024,6 +1024,7 @@
     CheckForIncludeFile stdio.h         && echo '#include <stdio.h>'
     CheckForIncludeFile unistd.h   && echo '#include <unistd.h>'
     CheckForIncludeFile string.h  && echo '#include <string.h>'
+    CheckForIncludeFile strings.h && echo '#include <strings.h>'
     CheckForIncludeFile stdlib.h && echo '#include <stdlib.h>'
     if CheckForDefine O_RDONLY fcntl.h; then
      echo '#include <fcntl.h>'