All of lore.kernel.org
 help / color / mirror / Atom feed
* Compile Problem !
@ 2003-07-18  8:27 Zoup
  2003-07-18 21:39 ` Loz
  0 siblings, 1 reply; 2+ messages in thread
From: Zoup @ 2003-07-18  8:27 UTC (permalink / raw)
  To: Linux-diald

Got this error on make ! :( 

iald.c
diald.c: In function `main':
diald.c:192: `CLK_TCK' undeclared (first use in this function)
diald.c:192: (Each undeclared identifier is reported only once
diald.c:192: for each function it appears in.)
make: *** [diald.o] Error 1

im running Slackware9 ! 
what is the problem ? :) 

thanks 
-- 
Wish You Were Here ...

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compile Problem !
  2003-07-18  8:27 Compile Problem ! Zoup
@ 2003-07-18 21:39 ` Loz
  0 siblings, 0 replies; 2+ messages in thread
From: Loz @ 2003-07-18 21:39 UTC (permalink / raw)
  To: Zoup; +Cc: Linux-diald

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Zoup wrote:

>Got this error on make ! :( 
>
>iald.c
>diald.c: In function `main':
>diald.c:192: `CLK_TCK' undeclared (first use in this function)
>diald.c:192: (Each undeclared identifier is reported only once
>diald.c:192: for each function it appears in.)
>make: *** [diald.o] Error 1
>
>im running Slackware9 ! 
>what is the problem ? :) 
>
>thanks 
>  
>
I had this problem way back, I dredged this out of the archive - hope it 
still works. If it doesn't, try mucking around with #include 
<sys/time.h> and #include <time.h> some order and combination will 
probably work.

cheers

Loz


[-- Attachment #2: message.eml --]
[-- Type: message/rfc822, Size: 7210 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1496 bytes --]

Here are a couple of patches for diald-1.0.

If autoconf defines both
HAVE_SYS_TIME_H and TIME_WITH_SYS_TIME
then *both* sys/time.h and time.h should be included,
but diald-1.0 fails to also include time.h, which defines CLK_TCK.
(older diald did include both)

Fixing this on a RedHat 7.x system (where both get defined)
fixes the undefined CLK_TCK problem in diald.c, without
messing with diald.c

So this may be the "correct" fix to the problem, rather than changing
#if CLK_TCK to #ifdef CLK_TCK in diald.c

the fix is now in diald.h:
--------------------------------------------------
diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
--- diald-1.0/diald.h   Sat Jun 16 12:01:25 2001
+++ diald-1.0-patched/diald.h   Fri Sep  7 02:57:56 2001
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>
----------------------------------------------------


(2) A compiler warning in timer.c is generated because the arguments of the
functions del_impulse() and del_connection()
in firewall.c should be passed as void * , and then be cast to
FW_unit * and FW_connection *, respectively.


This is fixed by the second attached patch




----------------------------------
E-Mail: duncan_haldane@users.sourceforge.net
Date: 12-Jan-2002
Time: 14:35:12

This message was sent by XFMail
----------------------------------

[-- Attachment #2.1.2: diald-1.0-void.patch --]
[-- Type: application/octet-stream, Size: 1733 bytes --]

diff -uNr diald-1.0/diald.h diald-1.0-void/diald.h
--- diald-1.0/diald.h	Sat Jun 16 12:01:25 2001
+++ diald-1.0-void/diald.h	Sat Jan 12 14:03:53 2002
@@ -488,6 +488,6 @@
 int getprotocol(const char *name);
 char *getprotonumber(int proto);
 int getsn(FILE *fp,char *buf,int len);
-void del_impulse(FW_unit *unit);
-void del_connection(FW_Connection *c);
+void del_impulse(void *unit);
+void del_connection(void *c);
 void slip_start_fail(void * data);
diff -uNr diald-1.0/firewall.c diald-1.0-void/firewall.c
--- diald-1.0/firewall.c	Sat Jun 16 15:51:39 2001
+++ diald-1.0-void/firewall.c	Sat Jan 12 14:25:17 2002
@@ -24,8 +24,6 @@
 int impulse_time = 0;
 int impulse_fuzz = 0;
 
-void del_connection(FW_Connection *);
-
 /*
  * Initialize the units.
  */
@@ -69,7 +67,7 @@
 #if 0
     mon_syslog(LOG_DEBUG,"slot def: %d %d %x %x %x",
 	slot->start, slot->end, slot->wday, slot->mday, slot->month);
-#endif 0
+#endif 
 	if ((slot->start <= ctime)
 	&&  (ctime <= slot->end)
 	&&  (slot->wday & (1<<ltime->tm_wday))
@@ -370,7 +368,7 @@
 	} else {
 	    /* timeout = 0, so toss the connection */
 	    del_timer(&c->timer);
-	    del_connection(c);
+	    del_connection((void *)c);
 	}
     }
 }
@@ -379,8 +377,9 @@
  * Get a connection out of a queue.
  */
 
-void del_connection(FW_Connection *c)
+void del_connection(void *c_void )
 {
+    FW_Connection *c = (FW_Connection *) c_void;
     if (debug&DEBUG_CONNECTION_QUEUE)
 	mon_syslog(LOG_DEBUG,"Deleting connection %p @ %ld",c,time(0));
 
@@ -390,9 +389,9 @@
     free(c);
 }
 
-void del_impulse(FW_unit *unit)
+void del_impulse(void  *unit_void)
 {
-
+    FW_unit *unit = (FW_unit *) unit_void;
     if (unit->impulse_mode) {
 	unit->impulse_mode = 0;
 	if (impulse_time > 0) {

[-- Attachment #2.1.3: diald-1.0.patch --]
[-- Type: application/octet-stream, Size: 388 bytes --]

diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
--- diald-1.0/diald.h	Sat Jun 16 12:01:25 2001
+++ diald-1.0-patched/diald.h	Fri Sep  7 02:57:56 2001
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-18 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18  8:27 Compile Problem ! Zoup
2003-07-18 21:39 ` Loz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.