From: Loz <loz@flower.powernet.co.uk>
To: Zoup <Zoup@zoup.org>
Cc: Linux-diald@vger.kernel.org
Subject: Re: Compile Problem !
Date: Fri, 18 Jul 2003 22:39:13 +0100 [thread overview]
Message-ID: <3F186901.9040507@flower.powernet.co.uk> (raw)
In-Reply-To: <200307181257.30926.Zoup@zoup.org>
[-- 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>
prev parent reply other threads:[~2003-07-18 21:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-18 8:27 Compile Problem ! Zoup
2003-07-18 21:39 ` Loz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F186901.9040507@flower.powernet.co.uk \
--to=loz@flower.powernet.co.uk \
--cc=Linux-diald@vger.kernel.org \
--cc=Zoup@zoup.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).