Fix compilation under Borland C

Hrvoje Niksic <[email protected]> Thu, 30 Jun 2005 22:46:20 +0200
Newsgroups gmane.comp.web.wget.patches
Message-ID <[email protected]>
This patch fixes some problems with compilation under Borland C, most
importantly header issues and a Makefile syntax problem.  It also
fixes bogus variable assignments thanks to Borland's warnings.


2005-06-27  Hrvoje Niksic  <[email protected]>

	* progress.c (dot_update): Remove unused variable row_qty.

2005-06-29  Hrvoje Niksic  <[email protected]>

	* main.c: Check for both SIGHUP and SIGUSR1 before using them.

Index: src/progress.c
===================================================================
--- src/progress.c	(revision 1913)
+++ src/progress.c	(revision 1915)
@@ -362,10 +362,6 @@
       ++dp->dots;
       if (dp->dots >= opt.dots_in_line)
 	{
-	  wgint row_qty = ROW_BYTES;
-	  if (dp->rows == dp->initial_length / ROW_BYTES)
-	    row_qty -= dp->initial_length % ROW_BYTES;
-
 	  ++dp->rows;
 	  dp->dots = 0;
 
Index: src/main.c
===================================================================
--- src/main.c	(revision 1913)
+++ src/main.c	(revision 1915)
@@ -64,7 +64,9 @@
 
 extern char *version_string;
 
+#if defined(SIGHUP) || defined(SIGUSR1)
 static void redirect_output_signal (int);
+#endif
 
 const char *exec_name;
 
@@ -1002,6 +1004,15 @@
 }
 
 #if defined(SIGHUP) || defined(SIGUSR1)
+
+/* So the signal_name check doesn't blow when only one is available. */
+#ifndef SIGHUP
+# define SIGHUP -1
+#endif
+#ifndef SIGUSR1
+# define SIGUSR1 -1
+#endif
+
 /* Hangup signal handler.  When wget receives SIGHUP or SIGUSR1, it
    will proceed operation as usual, trying to write into a log file.
    If that is impossible, the output will be turned off.  */
Index: windows/Makefile.src.bor
===================================================================
--- windows/Makefile.src.bor	(revision 1911)
+++ windows/Makefile.src.bor	(revision 1912)
@@ -58,15 +58,15 @@
 $(LIBDIR)\import32.lib+
 $(LIBDIR)\cw32.lib
 
+|
+
 $(OBJS): config-post.h config.h connect.h convert.h cookies.h ftp.h gen-md5.h \
          getopt.h gnu-md5.h hash.h host.h html-parse.h http-ntlm.h   \
          init.h log.h mswindows.h netrc.h options.h progress.h       \
          ptimer.h recur.h res.h retr.h safe-ctype.h ssl.h sysdep.h   \
          url.h utils.h wget.h xmalloc.h
 
-|
 
-
 #
 # Dependencies for cleanup
 #