bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: Fix compile error on IRIX 5.3


From: Rainer Orth
Subject: PATCH: Fix compile error on IRIX 5.3
Date: Mon, 28 Jul 2003 23:52:45 +0200 (MEST)

cvs 1.12.1 failed to compile on IRIX 5.3 (using the vendor cc) with the
following error:

cfe: Error: ../lib/xtime.h, line 41: redeclaration of 'timeb'; previous 
declaration at line 41 in file '../lib/xtime.h'
 struct timeb {
 -------^
cfe: Error: ../lib/xtime.h, line 42: Duplicate member 'time'
     time_t             time;            
 ----------             ^
cfe: Error: ../lib/xtime.h, line 43: Duplicate member 'millitm'
     unsigned short     millitm;         
 ------------------     ^
cfe: Error: ../lib/xtime.h, line 44: Duplicate member 'timezone'
     short              timezone;        
 ---------              ^
cfe: Error: ../lib/xtime.h, line 45: Duplicate member 'dstflag'
     short              dstflag;         
 ---------              ^

This happens because the platform doesn't define struct timeb, so the
lib/xtime.h definition is used.  Unfortunately, the file is included twice:
once via system.h, and a second time explicitly.  Since it lacks an
inclusion guard, we have two definitions.

The following patch fixes this.

        Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Mon Jul 28 23:51:47 2003  Rainer Orth  <address@hidden>

        * lock.c: Don't include xtime.h, already in system.h.
        * subr.c: Likewise.

Index: src/lock.c
===================================================================
RCS file: /cvsroot/ccvs/src/lock.c,v
retrieving revision 1.71
diff -u -p -r1.71 lock.c
--- src/lock.c  23 Jul 2003 21:49:31 -0000      1.71
+++ src/lock.c  28 Jul 2003 21:51:16 -0000
@@ -75,14 +75,10 @@
 #include "cvs.h"
 #include <assert.h>
 
-#ifdef HAVE_NANOSLEEP
-# include "xtime.h"
-#else /* HAVE_NANOSLEEP */
-# if !defined HAVE_USLEEP && defined HAVE_SELECT
-    /* use select as a workaround */
-#   include "xselect.h"
-# endif /* !defined HAVE_USLEEP && defined HAVE_SELECT */
-#endif /* !HAVE_NANOSLEEP */
+#if !defined HAVE_NANOSLEEP && !defined HAVE_USLEEP && defined HAVE_SELECT
+  /* use select as a workaround */
+# include "xselect.h"
+#endif /* !defined HAVE_NANOSLEEP && !defined HAVE_USLEEP && defined 
HAVE_SELECT */
 
 
 struct lock {
Index: src/subr.c
===================================================================
RCS file: /cvsroot/ccvs/src/subr.c,v
retrieving revision 1.89
diff -u -p -r1.89 subr.c
--- src/subr.c  25 Jul 2003 18:04:11 -0000      1.89
+++ src/subr.c  28 Jul 2003 21:51:16 -0000
@@ -15,14 +15,10 @@
 /* For functions with variable numbers of arguments */
 #include <stdarg.h>
 
-#ifdef HAVE_NANOSLEEP
-# include "xtime.h"
-#else /* HAVE_NANOSLEEP */
-# if !defined HAVE_USLEEP && defined HAVE_SELECT
-    /* use select as a workaround */
-#   include "xselect.h"
-# endif /* !defined HAVE_USLEEP && defined HAVE_SELECT */
-#endif /* !HAVE_NANOSLEEP */
+#if !defined HAVE_NANOSLEEP && !defined HAVE_USLEEP && defined HAVE_SELECT
+  /* use select as a workaround */
+# include "xselect.h"
+#endif /* !defined HAVE_NANOSLEEP && !defined HAVE_USLEEP && defined 
HAVE_SELECT */
 
 extern char *getlogin (void);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]