[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rwhois
Subject:    Patch for EGCS (RedHat6.0)
From:       Mark Smith  <msmith () fletch ! fix ! net>
Date:       1999-07-26 23:48:47
Message-ID: 19990726164847.B21182 () fletch ! fix ! net
[Download RAW message or body]

Thanks to Pete from Concentric for pointing me to the new version of the
source code (1.5.3) on the ftp site.

This code did not compile on RedHat 6.0, however.  I tried it on a 5.1
box and it compiled perfectly.  I'm assuming it's egcs on the 6.0 box
that's complaining..

Regardless, here's a .diff of what I needed to do to get it to compile.
Looking through code and comments a bit, I don't think this should
introduce any problems; I make no guarantees, however.

-Mark

diff -r -c rwhoisd-1.5.3/common/client_msgs.c rwhoisd-1.5.3-egcs/common/client_msgs.c
*** rwhoisd-1.5.3/common/client_msgs.c	Fri Jan 30 07:14:59 1998
--- rwhoisd-1.5.3-egcs/common/client_msgs.c	Mon Jul 26 16:42:07 1999
***************
*** 78,85 ****
    { RESP_QUERY, ""}
  };
  
  
- static FILE *out = stdout;
  static int  printed_error_flag = FALSE;
  
  void 
--- 78,91 ----
    { RESP_QUERY, ""}
  };
  
+ /* The following line has been modified by Mark Smith mark@halibut.com
+  * for egcs (RedHat 6.0).  Apparently, egcs doesn't like to initialize
+  * from a non-constant value:
+  *  client_msgs.c:84: initializer element is not constant
+  */
+ /* static FILE *out = stdout; */  /* Commented for egcs (RedHat6.0) */
+ static FILE *out;
  
  static int  printed_error_flag = FALSE;
  
  void 
diff -r -c rwhoisd-1.5.3/regexp/regexp.c rwhoisd-1.5.3-egcs/regexp/regexp.c
*** rwhoisd-1.5.3/regexp/regexp.c	Mon Nov  4 12:54:50 1996
--- rwhoisd-1.5.3-egcs/regexp/regexp.c	Mon Jul 26 16:42:39 1999
***************
*** 37,42 ****
--- 37,48 ----
   ***         include <string.h>
   *** to get a correct prototype for strlen(), to stop various compilers
   *** from complaining.    
+  *** THIS IS AN ALTERED VERSION.  It was altered by Mark Smith,
+  *** mark@halibut.com on 26 Jun 1999, to comment out the line
+  ***         extern char *strchr();
+  *** in regexec(), regmatch() and regrepeat() to keep egcs (RedHat 6.0)
+  *** from complaining.  Note that these lines were added by Philip Hazel
+  *** above for SunOS5 (Solaris 2); apparently egcs doesn't like them.
   *
   * Beware that some of this code is subtly aware of the way operator
   * precedence is structured in regular expressions.  Serious changes in
***************
*** 797,803 ****
  register char *string;
  {
  	register char *s;
! 	extern char *strchr();
  
  	/* Be paranoid... */
  	if (prog == NULL || string == NULL) {
--- 803,809 ----
  register char *string;
  {
  	register char *s;
! 	/* extern char *strchr(); */
  
  	/* Be paranoid... */
  	if (prog == NULL || string == NULL) {
***************
*** 896,902 ****
  {
  	register char *scan;	/* Current node. */
  	char *next;		/* Next node. */
! 	extern char *strchr();
  
  	scan = prog;
  #ifdef DEBUG
--- 902,908 ----
  {
  	register char *scan;	/* Current node. */
  	char *next;		/* Next node. */
! 	/* extern char *strchr(); */  /* For egcs (RedHat 6.0) */
  
  	scan = prog;
  #ifdef DEBUG
***************
*** 1101,1107 ****
  	register char *scan;
          register char *opnd;
  
!         extern char *strchr();
  
  	scan = reginput;
  	opnd = OPERAND(p);
--- 1107,1113 ----
  	register char *scan;
          register char *opnd;
  
!         /* extern char *strchr(); */
  
  	scan = reginput;
  	opnd = OPERAND(p);
***************
*** 1174,1180 ****
  	register char *s;
  	register char op = EXACTLY;	/* Arbitrary non-END op. */
  	register char *next;
! 	extern char *strchr();
  
  
  	s = r->program + 1;
--- 1180,1186 ----
  	register char *s;
  	register char op = EXACTLY;	/* Arbitrary non-END op. */
  	register char *next;
! 	/* extern char *strchr(); */
  
  
  	s = r->program + 1;
-- 
Mark Smith - The Fix Network, Engineering - 805.781.6301 - msmith@fix.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic