work around <sys/inttypes.h> not present in 1.3
This commit is contained in:
parent
3855b63dd9
commit
f66a2e85c2
3 changed files with 39 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.10 1998/08/20 15:17:11 tsarna Exp $
|
||||
# $NetBSD: Makefile,v 1.11 1998/10/02 06:47:29 hubertf Exp $
|
||||
# FreeBSD Id: Makefile,v 1.6 1997/10/15 20:35:20 fenner Exp
|
||||
#
|
||||
|
||||
|
@ -17,9 +17,10 @@ NO_WRKSUBDIR= yes
|
|||
USE_GMAKE= yes
|
||||
USE_X11= yes
|
||||
|
||||
# src/libs.tcl is autogenerated from the tcl/tk installed on the
|
||||
# build system, so we shouldn't use the one in the distribution.
|
||||
post-extract:
|
||||
-@rm ${WRKSRC}/src/libs.tcl
|
||||
_INTTYPES!= if [ -e /usr/include/sys/inttypes.h ]; then echo "Exists"; else echo "No go"; fi
|
||||
|
||||
.if (${_INTTYPES} == "Exists")
|
||||
CFLAGS+= -DHAVE_SYS_INTTYPES_H
|
||||
.endif
|
||||
|
||||
.include "../../mk/bsd.pkg.mk"
|
||||
|
|
|
@ -1,20 +1,27 @@
|
|||
$NetBSD: patch-ac,v 1.3 1998/09/13 18:02:10 garbled Exp $
|
||||
--- src/iohandler.c.orig Sun Sep 13 10:28:50 1998
|
||||
+++ src/iohandler.c Sun Sep 13 10:30:44 1998
|
||||
@@ -43,6 +43,7 @@
|
||||
$NetBSD: patch-ac,v 1.4 1998/10/02 06:47:29 hubertf Exp $
|
||||
--- src/iohandler.c.orig Thu Jan 8 20:40:17 1998
|
||||
+++ src/iohandler.c Fri Oct 2 08:26:48 1998
|
||||
@@ -43,6 +43,9 @@
|
||||
#include <time.h>
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
+#ifdef HAVE_SYS_INTTYPES_H
|
||||
+#include <sys/inttypes.h>
|
||||
+#endif
|
||||
#include <tk.h>
|
||||
#ifdef WIN32
|
||||
#define WM_WSOCK_READY WM_USER+123
|
||||
@@ -135,7 +136,7 @@
|
||||
@@ -134,8 +137,13 @@
|
||||
}
|
||||
sockproc[fd] = callback;
|
||||
#else
|
||||
Tcl_CreateFileHandler(fd,
|
||||
- mask, callback, (ClientData)fd);
|
||||
+#ifdef HAVE_SYS_INTTYPES_H
|
||||
+ Tcl_CreateFileHandler(fd,
|
||||
+ mask, callback, (ClientData)(intptr_t)fd);
|
||||
+#else
|
||||
Tcl_CreateFileHandler(fd,
|
||||
mask, callback, (ClientData)fd);
|
||||
+#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,35 @@
|
|||
$NetBSD: patch-ad,v 1.3 1998/09/13 18:02:10 garbled Exp $
|
||||
--- src/sd_listen.c.orig Sun Sep 13 10:34:47 1998
|
||||
+++ src/sd_listen.c Sun Sep 13 10:37:01 1998
|
||||
@@ -316,10 +316,10 @@
|
||||
$NetBSD
|
||||
--- src/sd_listen.c.orig Thu Jan 8 20:39:21 1998
|
||||
+++ src/sd_listen.c Fri Oct 2 08:30:50 1998
|
||||
@@ -316,11 +316,19 @@
|
||||
|
||||
if (strncmp(k1, "k=", 2)==0)
|
||||
{
|
||||
- if ((u_int)k2>=(u_int)k1+2)
|
||||
+#ifdef HAVE_SYS_INTTYPES_H
|
||||
+ if ((uintptr_t)k2>=(uintptr_t)k1+2)
|
||||
{
|
||||
- memcpy(key, k1+2, (u_int)k2-((u_int)k1+1));
|
||||
- key[(u_int)k2-((u_int)k1+1)]='\0';
|
||||
+ {
|
||||
+ memcpy(key, k1+2, (uintptr_t)k2-((uintptr_t)k1+1));
|
||||
+ key[(uintptr_t)k2-((uintptr_t)k1+1)]='\0';
|
||||
+ }
|
||||
+#else
|
||||
if ((u_int)k2>=(u_int)k1+2)
|
||||
{
|
||||
memcpy(key, k1+2, (u_int)k2-((u_int)k1+1));
|
||||
key[(u_int)k2-((u_int)k1+1)]='\0';
|
||||
}
|
||||
+#endif
|
||||
else
|
||||
{
|
||||
@@ -648,7 +648,7 @@
|
||||
key[0]='\0';
|
||||
@@ -648,7 +656,11 @@
|
||||
struct timeval tv;
|
||||
unsigned long src, hfrom;
|
||||
char *data;
|
||||
- int ix = rfd2sock[PTOI(fd)];
|
||||
+#ifdef HAVE_SYS_INTTYPES_H
|
||||
+ intptr_t ix = rfd2sock[PTOI(fd)];
|
||||
+#else
|
||||
int ix = rfd2sock[PTOI(fd)];
|
||||
+#endif
|
||||
|
||||
fromlen=sizeof(struct sockaddr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue