From 36e9976a43217bcc90e043c4bf1208c325b96ef2 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 15 Jan 2006 19:20:59 +0000 Subject: Add DragonFly support. Workaround a bug in DragonFly's time.h when compiling with _POSIX_SOURCE set (size_t doesn't get defined). Fix errno. Fix an incorrect va_arg: short gets promoted to int, so use that. --- emulators/twin/distinfo | 11 +++++++---- emulators/twin/patches/patch-aa | 18 +++++++++++------- emulators/twin/patches/patch-ae | 28 ++++++++++++++++++++++++---- emulators/twin/patches/patch-ak | 22 +++++++++++++++++++--- emulators/twin/patches/patch-am | 12 ++++++++++++ emulators/twin/patches/patch-an | 20 ++++++++++++++++++++ emulators/twin/patches/patch-ao | 16 ++++++++++++++++ 7 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 emulators/twin/patches/patch-am create mode 100644 emulators/twin/patches/patch-an create mode 100644 emulators/twin/patches/patch-ao (limited to 'emulators/twin') diff --git a/emulators/twin/distinfo b/emulators/twin/distinfo index 1f87627ba71..49b6ddcd064 100644 --- a/emulators/twin/distinfo +++ b/emulators/twin/distinfo @@ -1,17 +1,20 @@ -$NetBSD: distinfo,v 1.4 2005/02/23 18:49:21 agc Exp $ +$NetBSD: distinfo,v 1.5 2006/01/15 19:20:59 joerg Exp $ SHA1 (twin-src-3.1.14.tar.gz) = b1652f07adcc2c98948a4458480b2d8436cc893f RMD160 (twin-src-3.1.14.tar.gz) = e4b54f515505176498335387415dc5797b3e63eb Size (twin-src-3.1.14.tar.gz) = 2216218 bytes -SHA1 (patch-aa) = 7fe45414b89610b25015f814983c59003c35018d +SHA1 (patch-aa) = 05a391a08a6f9d8407a6b61b2388f68c60d62a30 SHA1 (patch-ab) = 7e7b4d3da2afb119a4222a953ae44251b0c253f2 SHA1 (patch-ac) = ead087b78674b30c076f132d71c3d372c77f0e1f SHA1 (patch-ad) = baf4144bf251e5eef3613fc7b2a4cc9168fa7292 -SHA1 (patch-ae) = 284da616e3e55716b2eb1faa0e86c16c3643d230 +SHA1 (patch-ae) = 572243b61d00492d257669132939c35dff98d9c8 SHA1 (patch-af) = 818f91cce6010145756221b90bd3461557c53d9a SHA1 (patch-ag) = 2f6f51e9f837920c7d0db11686071a6de2d66887 SHA1 (patch-ah) = 82deae0df4dd9f695b6a402fe9be8f4b9a9bc4f4 SHA1 (patch-ai) = 30c18f5770b839fbae7143ce2e0b435eb90cfc76 SHA1 (patch-aj) = 904103343dec345480b7566f9fe980fb027faade -SHA1 (patch-ak) = daa28ea5a1a2110a57948ea5ca0a59d060fca615 +SHA1 (patch-ak) = 6b5e3de5b714031f028656dceeb5cb263bf1f7aa SHA1 (patch-al) = 9c27e11439360db805d6d6165a3af0f75064dcec +SHA1 (patch-am) = 1df7aa9125830374cb52a02638249473c69af833 +SHA1 (patch-an) = 8eb83db7351e146bfb0357dd2f4495a38d28530b +SHA1 (patch-ao) = 7c4a48ad57d76238e097bcf9f1b2fe773cf374ff diff --git a/emulators/twin/patches/patch-aa b/emulators/twin/patches/patch-aa index 7a154c64480..e3a48882783 100644 --- a/emulators/twin/patches/patch-aa +++ b/emulators/twin/patches/patch-aa @@ -1,11 +1,15 @@ -$NetBSD: patch-aa,v 1.2 2003/03/08 03:15:51 jmc Exp $ +$NetBSD: patch-aa,v 1.3 2006/01/15 19:20:59 joerg Exp $ --- configure.in.orig Sun Jan 14 08:23:50 2001 +++ configure.in Fri Apr 5 22:31:14 2002 -@@ -147,6 +147,10 @@ +@@ -147,6 +147,14 @@ case "$host" in TARGET=freebsd ;; ++ i386-*-dragonfly* ) ++ TARGET=freebsd ++ ;; ++ + *netbsd* ) + TARGET=netbsd + ;; @@ -13,15 +17,15 @@ $NetBSD: patch-aa,v 1.2 2003/03/08 03:15:51 jmc Exp $ i*86-*-linux* ) TARGET=linux ;; -@@ -349,6 +353,11 @@ - powerpc-*-linux* ) +@@ -350,6 +358,11 @@ case "$host" in # egcs still broken on ppc TWIN_CFLAGS=-g -+ ;; + ;; + -+ *netbsd* ) ++ *netbsd* | *dragonfly* | *freebsd*) + LIBTWIN_LDFLAGS="$LDFLAGS $LIBTWIN_LDFLAGS" + DLL_LDFLAGS="$LDFLAGS $DLL_LDFLAGS" - ;; ++ ;; esac + dnl Determine the initialization method for shared libraries. diff --git a/emulators/twin/patches/patch-ae b/emulators/twin/patches/patch-ae index 1a6da2cf304..013dc8cbc72 100644 --- a/emulators/twin/patches/patch-ae +++ b/emulators/twin/patches/patch-ae @@ -1,11 +1,14 @@ -$NetBSD: patch-ae,v 1.1.1.1 2001/05/15 09:46:37 agc Exp $ +$NetBSD: patch-ae,v 1.2 2006/01/15 19:20:59 joerg Exp $ --- debugger/sig_context.h.orig Sun May 13 03:01:07 2001 +++ debugger/sig_context.h Sun May 13 03:25:31 2001 -@@ -59,6 +59,20 @@ +@@ -57,7 +57,21 @@ enum { - #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + #endif /* linux */ +-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) ++ +enum { + REG_GS = 0, REG_FS, REG_ES, REG_DS, + REG_EDI, REG_ESI, REG_EBP, @@ -19,7 +22,24 @@ $NetBSD: patch-ae,v 1.1.1.1 2001/05/15 09:46:37 agc Exp $ + REG_DI, REG_SI, + REG_FL +}; -+ + #include typedef struct sigcontext SIGCONTEXT; +@@ -120,7 +134,7 @@ typedef struct _CONTEXT /* Note 1 */ + + + #if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) \ +- || defined(__OpenBSD__) ++ || defined(__OpenBSD__) || defined(__DragonFly__) + #define EAX_sig(context) ((context)->sc_eax) + #define EBX_sig(context) ((context)->sc_ebx) +@@ -143,7 +157,7 @@ typedef struct _CONTEXT /* Note 1 */ + #define TRAP_sig(context) ((context)->sc_trapno) + #endif + +-#ifndef __FreeBSD__ ++#if !defined(__FreeBSD__) && !defined(__DragonFly__) + #define EFL_sig(context) ((context)->sc_eflags) + #else + #define EFL_sig(context) ((context)->sc_efl) diff --git a/emulators/twin/patches/patch-ak b/emulators/twin/patches/patch-ak index 8bdf1faf775..3f09cabe9fd 100644 --- a/emulators/twin/patches/patch-ak +++ b/emulators/twin/patches/patch-ak @@ -1,8 +1,16 @@ -$NetBSD: patch-ak,v 1.1 2004/07/11 00:55:19 wiz Exp $ +$NetBSD: patch-ak,v 1.2 2006/01/15 19:20:59 joerg Exp $ --- msdos/mfs_fileio.c.orig 2001-01-14 04:19:38.000000000 +0100 +++ msdos/mfs_fileio.c -@@ -213,8 +213,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3, +@@ -32,6 +32,7 @@ To send email to the maintainer of the W + + #include "platform.h" + ++#include + #include + #include + #include /* unlink() */ +@@ -213,8 +214,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3, (strcmp(filename, xdos.fileio[slot].filename) == 0) ) { /* Get the handle */ if ((handle = gethandle()) < 0) { @@ -13,7 +21,7 @@ $NetBSD: patch-ak,v 1.1 2004/07/11 00:55:19 wiz Exp $ return MAKELONG(NO_HANDLES & 0xffff,0xffff); } xdos.fileptr[handle] = &xdos.fileio[slot]; -@@ -232,8 +232,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3, +@@ -232,8 +233,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3, return unlink(filename); } } @@ -24,3 +32,11 @@ $NetBSD: patch-ak,v 1.1 2004/07/11 00:55:19 wiz Exp $ } } /* At this point, either the file was fclosed by us, or it was +@@ -332,7 +333,6 @@ mfs_openfile(char *filename, int mode, c + { + char altname[_MAX_PATH]; + int slot,handle,freeslot; +- extern int errno; + int drive; + int fd; + int nclosed; diff --git a/emulators/twin/patches/patch-am b/emulators/twin/patches/patch-am new file mode 100644 index 00000000000..2a511dbf584 --- /dev/null +++ b/emulators/twin/patches/patch-am @@ -0,0 +1,12 @@ +$NetBSD: patch-am,v 1.1 2006/01/15 19:20:59 joerg Exp $ + +--- msdos/dos_timer.c.orig 2006-01-15 18:50:44.000000000 +0000 ++++ msdos/dos_timer.c +@@ -31,6 +31,7 @@ To send email to the maintainer of the W + #include "platform.h" + + #define _POSIX_SOURCE 1 ++#include + #include + + diff --git a/emulators/twin/patches/patch-an b/emulators/twin/patches/patch-an new file mode 100644 index 00000000000..a1c6d31db03 --- /dev/null +++ b/emulators/twin/patches/patch-an @@ -0,0 +1,20 @@ +$NetBSD: patch-an,v 1.1 2006/01/15 19:20:59 joerg Exp $ + +--- msdos/fat_fileio.c.orig 2006-01-15 18:54:48.000000000 +0000 ++++ msdos/fat_fileio.c +@@ -30,6 +30,7 @@ To send email to the maintainer of the W + + #include "platform.h" + ++#include + #include + #include + #include +@@ -132,7 +133,6 @@ fat_open(DWORD p1, DWORD p2, DWORD p3, D + int DosHandle; + + int slot,handle,freeslot; +- extern int errno; + int nclosed; + LPMFSFILE fp; + DWORD DosDrive; diff --git a/emulators/twin/patches/patch-ao b/emulators/twin/patches/patch-ao new file mode 100644 index 00000000000..36d121ae59d --- /dev/null +++ b/emulators/twin/patches/patch-ao @@ -0,0 +1,16 @@ +$NetBSD: patch-ao,v 1.1 2006/01/15 19:20:59 joerg Exp $ + +--- windows/vsprintf32.c.orig 2006-01-15 18:59:25.000000000 +0000 ++++ windows/vsprintf32.c +@@ -264,9 +264,9 @@ wsprintfW(char * buf, LPCWSTR format, .. + num = va_arg(args, unsigned long); + else if (qualifier == 'h') + if (flags & SIGN) +- num = va_arg(args, short); ++ num = va_arg(args, int); + else +- num = va_arg(args, unsigned short); ++ num = va_arg(args, unsigned int); + else if (flags & SIGN) + num = va_arg(args, int); + else -- cgit v1.2.3