Make this build on amd64.

This commit is contained in:
dholland 2011-08-13 22:20:14 +00:00
parent ecb3a861e2
commit 8ac5a803f9
5 changed files with 87 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.3 2011/03/17 13:24:07 obache Exp $
$NetBSD: distinfo,v 1.4 2011/08/13 22:20:14 dholland Exp $
SHA1 (nvu-1.0-sources.tar.bz2) = 438b1633cb820bbede503ef2da90f46d4e96bee8
RMD160 (nvu-1.0-sources.tar.bz2) = 6d6fdb747d79e8602a4757e8eff8bbb21db6df8c
@ -11,4 +11,8 @@ SHA1 (patch-al) = 57a15074fca3ddba756d0b3898ad9bf06a6e130a
SHA1 (patch-an) = 99ac2da44322db96f8d65fbfdb380727b9da96fe
SHA1 (patch-ao) = 617d232bd335bc988388f2004ca919c829e371da
SHA1 (patch-ap) = 82a85df0b172f949509561f83ae7849e177babee
SHA1 (patch-netwerk_protocol_http_src_nshttpconnectionmgr_cpp) = 37d4aa3d3ce2f4885deaac3cdc97e0b010216511
SHA1 (patch-nsprpub_config_Makefile.in) = daf6423b53385c32e658fa5d93e33a0c5f31ca91
SHA1 (patch-nsprpub_pr_include_md__netbsd_cfg) = 4f65863a7516ed8c37a752e040ef1e3d4b881f29
SHA1 (patch-nsprpub_pr_include_md__netbsd_h) = 059df4799777743947b74ae39ed250c17c78ad37
SHA1 (patch-nsprpub_pr_src_io_prprf_c) = fabb1a52ced70a7640dd8a8d91e20e9672b22b76

View file

@ -0,0 +1,17 @@
$NetBSD: patch-netwerk_protocol_http_src_nshttpconnectionmgr_cpp,v 1.1 2011/08/13 22:20:14 dholland Exp $
Build on amd64.
--- netwerk/protocol/http/src/nsHttpConnectionMgr.cpp~ 2004-09-01 23:31:03.000000000 +0000
+++ netwerk/protocol/http/src/nsHttpConnectionMgr.cpp
@@ -834,8 +834,8 @@ nsHttpConnectionMgr::OnMsgReclaimConnect
void
nsHttpConnectionMgr::OnMsgUpdateParam(nsresult status, void *param)
{
- PRUint16 name = (PRUint32(param) & 0xFFFF0000) >> 16;
- PRUint16 value = PRUint32(param) & 0x0000FFFF;
+ PRUint16 name = (PRUint32((uintptr_t)param) & 0xFFFF0000) >> 16;
+ PRUint16 value = PRUint32((uintptr_t)param) & 0x0000FFFF;
switch (name) {
case MAX_CONNECTIONS:

View file

@ -0,0 +1,15 @@
$NetBSD: patch-nsprpub_pr_include_md__netbsd_cfg,v 1.1 2011/08/13 22:20:14 dholland Exp $
Build on amd64.
--- nsprpub/pr/include/md/_netbsd.cfg~ 2000-12-01 21:29:17.000000000 +0000
+++ nsprpub/pr/include/md/_netbsd.cfg
@@ -137,7 +137,7 @@
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
-#elif defined(__alpha__)
+#elif defined(__alpha__) || defined(__x86_64__)
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define HAVE_LONG_LONG

View file

@ -0,0 +1,32 @@
$NetBSD: patch-nsprpub_pr_include_md__netbsd_h,v 1.1 2011/08/13 22:20:14 dholland Exp $
Build on amd64.
--- nsprpub/pr/include/md/_netbsd.h~ 2003-09-11 17:24:53.000000000 +0000
+++ nsprpub/pr/include/md/_netbsd.h
@@ -42,6 +42,8 @@
#define _PR_SI_SYSNAME "NetBSD"
#if defined(__i386__)
#define _PR_SI_ARCHITECTURE "x86"
+#elif defined(__x86_64__)
+#define _PR_SI_ARCHITECTURE "x86-64"
#elif defined(__alpha__)
#define _PR_SI_ARCHITECTURE "alpha"
#elif defined(__m68k__)
@@ -108,6 +110,16 @@
}
#define _MD_GET_SP(_thread) CONTEXT(_thread)[2]
#endif
+#ifdef __x86_64__
+#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
+{ \
+ sigsetjmp(CONTEXT(_thread), 1); \
+ CONTEXT(_thread)[_JB_RSP] = (unsigned char*) ((_sp) - 128); \
+ CONTEXT(_thread)[_JB_PC] = (int) _main; \
+ *status = PR_TRUE; \
+}
+#define _MD_GET_SP(_thread) CONTEXT(_thread)[_JB_RSP]
+#endif
#ifdef __sparc__
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
{ \

View file

@ -0,0 +1,18 @@
$NetBSD: patch-nsprpub_pr_src_io_prprf_c,v 1.1 2011/08/13 22:20:14 dholland Exp $
Use valid va_list handling.
--- nsprpub/pr/src/io/prprf.c~ 2004-03-09 03:18:19.000000000 +0000
+++ nsprpub/pr/src/io/prprf.c
@@ -51,7 +51,10 @@
** Note: on some platforms va_list is defined as an array,
** and requires array notation.
*/
-#if (defined(LINUX) && defined(__x86_64__))
+#if __STDC__ >= 19990101 || defined(__NetBSD__) || defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || defined(__DragonFly__)
+#define VARARGS_ASSIGN(foo, bar) va_copy((foo), (bar))
+#elif (defined(LINUX) && defined(__x86_64__))
#define VARARGS_ASSIGN(foo, bar) __va_copy((foo), (bar))
#elif (defined(LINUX) && defined(__powerpc__)) || \
(defined(LINUX) && defined(__s390__)) || \