diff options
author | joerg <joerg@pkgsrc.org> | 2006-04-11 15:08:38 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2006-04-11 15:08:38 +0000 |
commit | 3b6df974e14b3a39c84f9020a7d361f38198a3ed (patch) | |
tree | 5c21a304bfe4cec3a6c5e6ab79fe1c4aca0646be /mail/ja-mh/patches/patch-ag | |
parent | 6e38cf71ae5bfe0c17d0ded676eec7c86eb362cb (diff) | |
download | pkgsrc-3b6df974e14b3a39c84f9020a7d361f38198a3ed.tar.gz |
Add DragonFly support. Fix errno usage. Remove special-casing
of FreeBSD-like systems with objformat, we want minor shared library
numbers.
Diffstat (limited to 'mail/ja-mh/patches/patch-ag')
-rw-r--r-- | mail/ja-mh/patches/patch-ag | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/mail/ja-mh/patches/patch-ag b/mail/ja-mh/patches/patch-ag new file mode 100644 index 00000000000..10fb8bd58c7 --- /dev/null +++ b/mail/ja-mh/patches/patch-ag @@ -0,0 +1,110 @@ +$NetBSD: patch-ag,v 1.3 2006/04/11 15:08:38 joerg Exp $ + +--- sbr/m_getfld.c.orig 2001-06-13 14:21:02.000000000 +0000 ++++ sbr/m_getfld.c +@@ -186,6 +186,9 @@ static int (*eom_action) () = NULL; + #define _cnt _r /* Retch */ + #define _filbuf __srget /* Puke */ + #endif ++#ifdef __DragonFly__) ++#define _filbuf __srget /* Puke */ ++#endif + + /* */ + +@@ -302,6 +305,9 @@ register FILE *iob; + bp = sp = (unsigned char *) iob->_IO_read_ptr - 1; + j = (cnt = ((long) iob->_IO_read_end - (long) iob->_IO_read_ptr) + 1) < i? + cnt: i; ++#elif defined(__DragonFly__) ++ bp = sp = (unsigned char *) ((struct __FILE_public *)iob)->_p - 1; ++ j = (cnt = ((struct __FILE_public *)iob)->_r+1) < i ? cnt : i; + #else + bp = sp = (unsigned char *) iob->_ptr - 1; + j = (cnt = iob->_cnt+1) < i ? cnt : i; +@@ -332,6 +338,9 @@ register FILE *iob; + } else { + #ifdef _STDIO_USES_IOSTREAM + iob->_IO_read_ptr = bp + 1; ++#elif defined(__DragonFly__) ++ ((struct __FILE_public *)iob)->_p = bp + 1; ++ ((struct __FILE_public *)iob)->_r = cnt - 1; + #else + iob->_ptr = bp + 1; + iob->_cnt = cnt - 1; +@@ -377,6 +386,8 @@ register FILE *iob; + #ifdef _STDIO_USES_IOSTREAM + cnt = (long) iob->_IO_read_end - (long) iob->_IO_read_ptr; + bp = (unsigned char *) --iob->_IO_read_ptr; ++#elif defined(__DragonFly__) ++ cnt = ((struct __FILE_public *)iob)->_r++; bp = (unsigned char *) --((struct __FILE_public *)iob)->_p; + #else + cnt = iob->_cnt++; bp = (unsigned char *) --iob->_ptr; + #endif +@@ -390,6 +401,10 @@ register FILE *iob; + j = ep - (unsigned char *) iob->_IO_read_ptr; + (void) bcopy( iob->_IO_read_ptr, cp, j); + iob->_IO_read_ptr = ep; ++#elif defined(__DragonFly__) ++ j = ep - (unsigned char *) ((struct __FILE_public *)iob)->_p; ++ (void) bcopy( ((struct __FILE_public *)iob)->_p, cp, j); ++ ((struct __FILE_public *)iob)->_p = ep; ((struct __FILE_public *)iob)->_r -= j; + #else + j = ep - (unsigned char *) iob->_ptr; + (void) bcopy( iob->_ptr, cp, j); +@@ -407,6 +422,9 @@ register FILE *iob; + #ifdef _STDIO_USES_IOSTREAM + c += bp - (unsigned char *) iob->_IO_read_ptr; + (void) bcopy( iob->_IO_read_ptr, cp, c); ++#elif defined(__DragonFly__) ++ c += bp - (unsigned char *) ((struct __FILE_public *)iob)->_p; ++ (void) bcopy( ((struct __FILE_public *)iob)->_p, cp, c); + #else + c += bp - (unsigned char *) iob->_ptr; + (void) bcopy( iob->_ptr, cp, c); +@@ -416,6 +434,8 @@ register FILE *iob; + /* the dest buffer is full */ + #ifdef _STDIO_USES_IOSTREAM + iob->_IO_read_ptr += c; ++#elif defined(__DragonFly__) ++ ((struct __FILE_public *)iob)->_r -= c; ((struct __FILE_public *)iob)->_p += c; + #else + iob->_cnt -= c; iob->_ptr += c; + #endif +@@ -434,6 +454,8 @@ register FILE *iob; + iob->_IO_read_ptr = iob->_IO_read_end; + c = __underflow((struct _IO_FILE *) iob); + iob->_IO_read_ptr++; /* NOT automatic! */ ++#elif defined(__DragonFly__) ++ *cp++ = j = *(((struct __FILE_public *)iob)->_p + c); + #else + *cp++ = j = *(iob->_ptr + c); + #ifdef FILBUF_ADJ +@@ -467,6 +489,8 @@ register FILE *iob; + if (c != EOF) + #ifdef _STDIO_USES_IOSTREAM + --iob->_IO_read_ptr; ++#elif defined(__DragonFly__) ++ --((struct __FILE_public *)iob)->_p, ++((struct __FILE_public *)iob)->_r; + #else + --iob->_ptr, ++iob->_cnt; + #endif +@@ -488,6 +512,8 @@ register FILE *iob; + #ifdef _STDIO_USES_IOSTREAM + bp = (unsigned char *) --iob->_IO_read_ptr; + cnt = (long) iob->_IO_read_end - (long) iob->_IO_read_ptr; ++#elif defined(__DragonFly__) ++ bp = (unsigned char *) --((struct __FILE_public *)iob)->_p; cnt = ++((struct __FILE_public *)iob)->_r; + #else + bp = (unsigned char *) --iob->_ptr; cnt = ++iob->_cnt; + #endif +@@ -549,6 +575,9 @@ register FILE *iob; + (void) bcopy( bp, buf, c ); + #ifdef _STDIO_USES_IOSTREAM + iob->_IO_read_ptr += c; ++#elif defined(__DragonFly__) ++ ((struct __FILE_public *)iob)->_r -= c; ++ ((struct __FILE_public *)iob)->_p += c; + #else + iob->_cnt -= c; + iob->_ptr += c; |