diff options
author | christos <christos@pkgsrc.org> | 2012-03-23 22:32:59 +0000 |
---|---|---|
committer | christos <christos@pkgsrc.org> | 2012-03-23 22:32:59 +0000 |
commit | 91dded9c47175491fdb5a2e364dd4f8d8b39440e (patch) | |
tree | 39aaca02c5e4b2e8386b533fada4008ee791a719 /math/octave | |
parent | 8506eb0dd09bedbf95866cda5e278e8fa3c787da (diff) | |
download | pkgsrc-91dded9c47175491fdb5a2e364dd4f8d8b39440e.tar.gz |
Fix the bloody fpos_t/off_t mess.
Diffstat (limited to 'math/octave')
-rw-r--r-- | math/octave/distinfo | 4 | ||||
-rw-r--r-- | math/octave/patches/patch-fflush-fpos_t.c | 36 | ||||
-rw-r--r-- | math/octave/patches/patch-fseeko-fpos_t.c | 40 |
3 files changed, 79 insertions, 1 deletions
diff --git a/math/octave/distinfo b/math/octave/distinfo index 61ccbea349f..f2e30597355 100644 --- a/math/octave/distinfo +++ b/math/octave/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.31 2011/12/24 23:46:02 asau Exp $ +$NetBSD: distinfo,v 1.32 2012/03/23 22:32:59 christos Exp $ SHA1 (octave-3.4.3.tar.bz2) = fe622c28a38f8730c59e46211bc7b18e7f51a679 RMD160 (octave-3.4.3.tar.bz2) = d6f43fca9097b40f163c140db853d8ac1383ab39 Size (octave-3.4.3.tar.bz2) = 15085117 bytes +SHA1 (patch-fflush-fpos_t.c) = 24ed7f95f8431b59bc5ee0dfb0e6624b8029f512 +SHA1 (patch-fseeko-fpos_t.c) = ca846a014f9adfd47f7bbcf6557bf26a53f4a8e9 SHA1 (patch-libcruft_arpack_util_second.f) = 47d7e33f7fd3c74c737935c6ecac88fee350519f SHA1 (patch-libgnu_string.in.h) = 4af39b76faa3ac90454a9d664919b7a6cd45fa9d SHA1 (patch-liboctave_oct-time.cc) = 40c21f509b6c95942e6ba43c52494d1d707ed515 diff --git a/math/octave/patches/patch-fflush-fpos_t.c b/math/octave/patches/patch-fflush-fpos_t.c new file mode 100644 index 00000000000..23bbaeb29da --- /dev/null +++ b/math/octave/patches/patch-fflush-fpos_t.c @@ -0,0 +1,36 @@ +$NetBSD: patch-fflush-fpos_t.c,v 1.1 2012/03/23 22:32:59 christos Exp $ + +--- libgnu/fflush.c.orig 2011-08-03 23:59:51.000000000 -0400 ++++ libgnu/fflush.c 2012-03-23 18:24:54.000000000 -0400 +@@ -24,6 +24,7 @@ + #include <stdio.h> + + #include <errno.h> ++#include <string.h> + #include <unistd.h> + + #include "freading.h" +@@ -97,17 +98,12 @@ + /* fp_->_offset is typed as an integer. */ + fp_->_offset = pos; + # else +- /* fp_->_offset is an fpos_t. */ +- /* Use a union, since on NetBSD, the compilation flags determine +- whether fpos_t is typedef'd to off_t or a struct containing a +- single off_t member. */ +- union +- { +- fpos_t f; +- off_t o; +- } u; +- u.o = pos; +- fp_->_offset = u.f; ++ /* ++ * fp_->_offset is an fpos_t or off_t ++ * in either case the off_t part is the first member of it. ++ */ ++ memset(&fp_->_offset, 0, sizeof(fp_->_offset)); ++ memcpy(&fp_->_offset, &pos, sizeof(pos)); + # endif + fp_->_flags |= __SOFF; + #endif diff --git a/math/octave/patches/patch-fseeko-fpos_t.c b/math/octave/patches/patch-fseeko-fpos_t.c new file mode 100644 index 00000000000..884c83b11cc --- /dev/null +++ b/math/octave/patches/patch-fseeko-fpos_t.c @@ -0,0 +1,40 @@ +$NetBSD: patch-fseeko-fpos_t.c,v 1.1 2012/03/23 22:32:59 christos Exp $ + +--- libgnu/fseeko.c.orig 2011-08-09 22:10:48.000000000 -0400 ++++ libgnu/fseeko.c 2012-03-23 18:24:47.000000000 -0400 +@@ -25,6 +25,9 @@ + /* Get off_t and lseek. */ + #include <unistd.h> + ++/* mem* */ ++#include <string.h> ++ + #include "stdio-impl.h" + + int +@@ -115,19 +118,12 @@ + /* fp_->_offset is typed as an integer. */ + fp_->_offset = pos; + # else +- /* fp_->_offset is an fpos_t. */ +- { +- /* Use a union, since on NetBSD, the compilation flags +- determine whether fpos_t is typedef'd to off_t or a struct +- containing a single off_t member. */ +- union +- { +- fpos_t f; +- off_t o; +- } u; +- u.o = pos; +- fp_->_offset = u.f; +- } ++ /* ++ * fp_->_offset is an fpos_t or off_t ++ * in either case the off_t part is the first member of it. ++ */ ++ memset(&fp_->_offset, 0, sizeof(fp_->_offset)); ++ memcpy(&fp_->_offset, &pos, sizeof(pos)); + # endif + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; |