pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/math/octave



Module Name:    pkgsrc
Committed By:   adam
Date:           Wed Dec 15 17:20:58 UTC 2021

Modified Files:
        pkgsrc/math/octave: Makefile PLIST distinfo
        pkgsrc/math/octave/patches: patch-m4_acinclude.m4
Added Files:
        pkgsrc/math/octave/patches: patch-libgnu_fseeko.c
Removed Files:
        pkgsrc/math/octave/patches: patch-fseeko-fpos_t.c
            patch-liboctave_wrappers_iconv-wrappers.c

Log Message:
octave: updated to 6.4.0

Summary of bugs fixed for version 6.4.0 (2021-10-30)
----------------------------------------------------

Improvements and fixes

- Reduce memory usage in BISTs for `copyobj`, `hgsave`.
- `hgsave.m`, `copyobj.m`: Use `'qt'` graphics toolkit in BISTs.
- `main.cc`: Use `getopt` to parse command line arguments.
- `main.cc`: Remove invalid case.
- Disable `getopt` error reporting in wrapper program.
- `interp1.m`: Don't interpret later numeric input as `xi`.
- `pkg`: Improve similar package name suggestion.
- Store parent name in function object when caching parents in scope.
- Avoid internal error and segfault with `eval` and scripts.
- `rmpath`: Prevent removing the current directory from the load path.

GUI

- Fix missing interpreter event in `octave-scintilla`.
- Fix opening a file in a custom editor.

Documentation

- Improve docstring for `disable_diagonal_matrix`, `disable_diagonal_matrix`,
  and `disable_range`.
- `cbrt`: Clarify that function errors for non-real input.
- `dsearchn.m`: Added optional distance output description.
- Add Hungarian translation for project description files.
- Document fsolve output "info" -2.

Build system

- Correct error message for incompatible CXSparse.

Summary of bugs fixed for version 6.3.0 (2021-07-11)
----------------------------------------------------

Important notice

- This bug fix release breaks ABI compatiblity with Octave 6.2.0. Re-build
  binaries (like .oct or .mex files) when updating to this version.

Improvements and fixes

- `ls-hdf5.cc`: Avoid throwing inside HDF5 function.
- `ls-hdf5.cc`: Handle non-zero terminated type strings.
- Fix occasional segfault in `symbfact`.
- `fsolve.m`: Fix undefined output error when using `Output` function.
- Fix compilation error with `iconv_t` on Solaris.
- build: Check for `stropts.h`.
- Avoid ambiguous call to `pow`.
- Fix context link when creating handle to nested function.
- `print.m`: Warn when figure is too large to be printed to output page.
- Defer clearing function vars until stack frame is deleted.
- Avoid memory leaks when returning handles to nested functions.
- Hold references to closure frames in anon functions if needed.
- `eigs`: Prevent possible segmentation fault at exit.
- Issue warning when gnuplot graphics toolkit is initialized.
- mpoles.m: Fix detection of pole multiplicity.
- Perform shutdown actions in interpreter destructor.
- build: Make relocation of dependencies with Octave optional.
- `qz.cc`: Return correct number of eigenvalues.
- `qz.cc`: Let test pass with LAPACK 3.9.1 and earlier versions.
- `pkg.m`: Use default prefixes unless otherwise set previously.
- `betaincinv.m`: Correctly handle small inputs.
- `betaincinv.m`: Correctly handle inputs very close to 1.0.
- `unistd-wrappers.c`: Allocate sufficient memory for `new_argv`.
- Mark system functions correctly if `OCTAVE_HOME` is non-canonical.
- Mark compiled system functions correctly if `OCTAVE_HOME` is non-canonical.
- Fix error if test suite is run before Octave is installed.
- `lo-array-errwarn.cc`: Include `<limits>`.
- Use `std::size_t` and `std::ptrdiff_t` in C++ code.
- Use `std::size_t` in more instances.
- Return proper number of stack frames for `dbstack (N)` call.
- Avoid ambiguous match of overloaded function.
- `lscov.m`: Relax BIST tolerance to pass with OpenBLAS.
- `print`: Fix error when `"px"` word is present in a figure.
- `logm.m`: Fix check for real negative values in complex vector.
- build: Set necessary flags to allow execution on Windows Vista.
- Declare base_parser destructor virtual.
- `hist.m`: Improve handling and docstring for third parameter "norm".
- `logm.m`: Allow tolerance in check for real negative values in complex vector.
- `expm.m`, `logm.m`: Use function `isdiag` to detect if input is a diagonal matrix.
- tests: Relax tolerance for some tests on macOS.
- `logspace.m`: Mark tests as known to fail on macOS.
- `hist.m`: Use deterministic test.
- `rgb2ind.m`: Reduce memory usage and eliminate randomness in test.
- `logm.m`: Allow larger tolerance for test on macOS.
- build: Use correct path to `octave` binary in build tree on macOS.
- build: Fix typo in folder to libraries when building `.oct` or `.mex` files.
- build: Set DL_LDFLAGS in the build rules for .oct or .mex files.
- `rgb2ind.m`: Suppress output in test.
- Improve documentation for `log2` function.
- `ind2sub`: Fix typo in "see also" section of docstring.
- `mrdivide`, `mldivide`: Document that functions might return minimum norm solutions.
- Fix scoping issue for handles to sibling nested functions.
- `ls-mat5.cc`: Avoid integer overflow in calculation of buffer size for zlib.
- Move top-level REPL from interpreter to evaluator.
- Avoid crash with `dbquit` when executing command in terminal from GUI.

GUI

- Fix calling external editor.
- Fix missing file suffix .m when saving a new script.
- Do not run files that are not saved as Octave files.
- Fix confirm overwrite for native editor file "save as" dialogs.
- Fix crash when GUI tries to restore missing previous Octave dir.
- Fix restoring the horizontal position of docked GUI widgets.
- Prevent floating widgets from re-opening after restart.
- Avoid crash in GUI for `rmdir("")`.
- Fix EOL mode when saving files under new names.
- Fix auto indentation of switch-structure in GUI editor.
- Avoid crash when closing GUI with open editor tabs.
- `octave-qscintilla.cc` (`contextmenu_run`): Fix keyboard command handling.

Documentation

- Improve Differential Equations chapter and example for lsode.
- Clarify usage of "Depends" keyword in package `DESCRIPTION` file.
- Add note that wildcard patterns for `save` are glob patterns.
- Change example for Delaunay triangulation to match the generating code.
- Document single precision issues with OpenGL graphics toolkits.
- Minor changes to documentation of single precision issues with OpenGL.
- Expand on documentation for command syntax.
- `isprop.m`: Document that function only works on graphics objects in Octave 6.X.
- Explain how to write dual-purpose executable scripts and Octave functions.
- Update keyword docstrings.
- Use Texinfo commands to improve `transpose()` docstring rendering.
- `betainc.m`, `betaincinv.m`: Correct non-TeX definition of beta incomplete integral.
- Grammarcheck documentation ahead of 6.3 release.
- Spellcheck documentation ahead of 6.3 release.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 pkgsrc/math/octave/Makefile
cvs rdiff -u -r1.36 -r1.37 pkgsrc/math/octave/PLIST
cvs rdiff -u -r1.63 -r1.64 pkgsrc/math/octave/distinfo
cvs rdiff -u -r1.2 -r0 pkgsrc/math/octave/patches/patch-fseeko-fpos_t.c \
    pkgsrc/math/octave/patches/patch-liboctave_wrappers_iconv-wrappers.c
cvs rdiff -u -r0 -r1.1 pkgsrc/math/octave/patches/patch-libgnu_fseeko.c
cvs rdiff -u -r1.3 -r1.4 pkgsrc/math/octave/patches/patch-m4_acinclude.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/math/octave/Makefile
diff -u pkgsrc/math/octave/Makefile:1.225 pkgsrc/math/octave/Makefile:1.226
--- pkgsrc/math/octave/Makefile:1.225   Wed Dec  8 16:05:35 2021
+++ pkgsrc/math/octave/Makefile Wed Dec 15 17:20:57 2021
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.225 2021/12/08 16:05:35 adam Exp $
+# $NetBSD: Makefile,v 1.226 2021/12/15 17:20:57 adam Exp $
 
-DISTNAME=      octave-6.2.0
-PKGREVISION=   5
+DISTNAME=      octave-6.4.0
 CATEGORIES=    math
 MASTER_SITES=  ${MASTER_SITE_GNU:=octave/}
 EXTRACT_SUFX=  .tar.xz
@@ -31,14 +30,11 @@ GNU_CONFIGURE=              yes
 # octave-forge package or user written ones compiled with mkoctfile
 CONFIGURE_ARGS+=       --enable-static
 CONFIGURE_ARGS+=       --enable-shared
-#CONFIGURE_ARGS+=      --without-opengl
-#CONFIGURE_ARGS+=      --with-framework-opengl=no
 CONFIGURE_ARGS+=       --disable-java
 CONFIGURE_ARGS+=       --disable-docs
-TEST_TARGET=           check
-
 CONFIGURE_ARGS+=       --with-blas=${BLAS_LIBS:Q}
 CONFIGURE_ARGS+=       --with-lapack=${LAPACK_LIBS:Q}
+TEST_TARGET=           check
 
 # Provide a full path gfortran in MKOCTFILE for octave-forge
 CONFIGURE_ENV+=                MKOCTFILE_F77=${FCPATH}
@@ -109,9 +105,13 @@ post-install:
 .for f in ${OCTAVE_INFO}
        ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${PKGINFODIR}
 .endfor
-
        ${RM} -f ${DESTDIR}/${PREFIX}/lib/charset.alias
 
+.if ${OPSYS} != "Darwin"
+# Also can use osmesa for plotting.
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.endif
 .include "../../audio/libsndfile/buildlink3.mk"
 .include "../../devel/gperf/buildlink3.mk"
 .include "../../devel/ncurses/buildlink3.mk"
@@ -119,20 +119,15 @@ post-install:
 .include "../../devel/readline/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../graphics/hicolor-icon-theme/buildlink3.mk"
-# Also can use osmesa for plotting.
-.include "../../graphics/MesaLib/buildlink3.mk"
 .include "../../graphics/gl2ps/buildlink3.mk"
 .include "../../math/arpack-ng/buildlink3.mk"
-.include "../../mk/blas.buildlink3.mk"
 .include "../../math/fftw/buildlink3.mk"
 .include "../../math/qrupdate/buildlink3.mk"
 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
 .include "../../www/curl/buildlink3.mk"
 .include "../../x11/fltk13/buildlink3.mk"
-.if ${OPSYS} != "Darwin"
-.include "../../x11/libX11/buildlink3.mk"
-.endif
 .include "../../x11/qt5-qtbase/buildlink3.mk"
 .include "../../x11/qt5-qttools/buildlink3.mk"
 .include "../../x11/qt5-qscintilla/buildlink3.mk"
+.include "../../mk/blas.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/math/octave/PLIST
diff -u pkgsrc/math/octave/PLIST:1.36 pkgsrc/math/octave/PLIST:1.37
--- pkgsrc/math/octave/PLIST:1.36       Mon Jun 14 22:16:33 2021
+++ pkgsrc/math/octave/PLIST    Wed Dec 15 17:20:57 2021
@@ -1,8 +1,8 @@
-@comment $NetBSD: PLIST,v 1.36 2021/06/14 22:16:33 nros Exp $
+@comment $NetBSD: PLIST,v 1.37 2021/12/15 17:20:57 adam Exp $
+bin/${PKGNAME}
 bin/mkoctfile
 bin/mkoctfile-${PKGVERSION}
 bin/octave
-bin/${PKGNAME}
 bin/octave-cli
 bin/octave-cli-${PKGVERSION}
 bin/octave-config
@@ -786,10 +786,16 @@ lib/octave/${PKGVERSION}/oct/${MACHINE_G
 lib/octave/${PKGVERSION}/oct/${MACHINE_GNU_PLATFORM}/convhulln.oct
 lib/octave/${PKGVERSION}/oct/${MACHINE_GNU_PLATFORM}/fftw.oct
 lib/octave/${PKGVERSION}/oct/${MACHINE_GNU_PLATFORM}/gzip.oct
+@pkgdir lib/octave/${PKGVERSION}/site/oct/${MACHINE_GNU_PLATFORM}
+@pkgdir lib/octave/site/oct/${MACHINE_GNU_PLATFORM}
+@pkgdir lib/octave/site/oct/api-v55/${MACHINE_GNU_PLATFORM}
 lib/pkgconfig/octave.pc
 lib/pkgconfig/octinterp.pc
 libexec/octave/${PKGVERSION}/exec/${MACHINE_GNU_PLATFORM}/octave-gui
 libexec/octave/${PKGVERSION}/exec/${MACHINE_GNU_PLATFORM}/octave-svgconvert
+@pkgdir libexec/octave/${PKGVERSION}/site/exec/${MACHINE_GNU_PLATFORM}
+@pkgdir libexec/octave/api-v55/site/exec/${MACHINE_GNU_PLATFORM}
+@pkgdir libexec/octave/site/exec/${MACHINE_GNU_PLATFORM}
 man/man1/mkoctfile.1
 man/man1/octave-cli.1
 man/man1/octave-config.1
@@ -962,6 +968,14 @@ share/octave/${PKGVERSION}/etc/tests/fix
 share/octave/${PKGVERSION}/etc/tests/fixed/bug-59704/bug59704_2.m
 share/octave/${PKGVERSION}/etc/tests/fixed/bug-59937/bug-59937.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/bug-59937/eval_global_script.m
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-60237/bug-60237.tst
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-60237/bug_60237.m
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61105/bug-61105.tst
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61105/nested_test_1.m
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61105/nested_test_2.m
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61105/nested_test_3.m
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61191/bug-61191.tst
+share/octave/${PKGVERSION}/etc/tests/fixed/bug-61191/subdir/bug_61191.m
 share/octave/${PKGVERSION}/etc/tests/fixed/class-concat/@foo/foo.m
 share/octave/${PKGVERSION}/etc/tests/fixed/class-concat/class-concat.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/classdef-multiple-inheritance/base_1.m
@@ -1116,8 +1130,10 @@ share/octave/${PKGVERSION}/etc/tests/fix
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/bug57941a.m
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/bug57941b.m
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/bug58519.tst
+share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/bug60845.m
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/derived-resolution.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/f1.m
+share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/handle-to-sibling.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/keyword.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/object-method.tst
 share/octave/${PKGVERSION}/etc/tests/fixed/fcn-handle/package-function.tst
@@ -2377,12 +2393,6 @@ share/octave/${PKGVERSION}/m/web/web.m
 share/octave/${PKGVERSION}/m/web/weboptions.m
 share/octave/${PKGVERSION}/m/web/webread.m
 share/octave/${PKGVERSION}/m/web/webwrite.m
-share/octave/site/m/startup/octaverc
-@pkgdir share/octave/site/api-v55/m
 @pkgdir share/octave/${PKGVERSION}/site/m
-@pkgdir lib/octave/site/oct/${MACHINE_GNU_PLATFORM}
-@pkgdir lib/octave/site/oct/api-v55/${MACHINE_GNU_PLATFORM}
-@pkgdir lib/octave/${PKGVERSION}/site/oct/${MACHINE_GNU_PLATFORM}
-@pkgdir libexec/octave/site/exec/${MACHINE_GNU_PLATFORM}
-@pkgdir libexec/octave/api-v55/site/exec/${MACHINE_GNU_PLATFORM}
-@pkgdir libexec/octave/${PKGVERSION}/site/exec/${MACHINE_GNU_PLATFORM}
+@pkgdir share/octave/site/api-v55/m
+share/octave/site/m/startup/octaverc

Index: pkgsrc/math/octave/distinfo
diff -u pkgsrc/math/octave/distinfo:1.63 pkgsrc/math/octave/distinfo:1.64
--- pkgsrc/math/octave/distinfo:1.63    Tue Oct 26 10:55:50 2021
+++ pkgsrc/math/octave/distinfo Wed Dec 15 17:20:57 2021
@@ -1,17 +1,16 @@
-$NetBSD: distinfo,v 1.63 2021/10/26 10:55:50 nia Exp $
+$NetBSD: distinfo,v 1.64 2021/12/15 17:20:57 adam Exp $
 
-BLAKE2s (octave-6.2.0.tar.xz) = 4ad5851b1c5fe3f07bc3c887bd3f554b7403bdac0049f559f75bcc27922c749f
-SHA512 (octave-6.2.0.tar.xz) = 7a0d9ee5fd739bd9bd5d2d57faf9e800ccc760afbb840ec5e3371d1e1564163a6190587e31b16d22ae834162917049a0e2789663294030aa84ee86430127eade
-Size (octave-6.2.0.tar.xz) = 25131148 bytes
+BLAKE2s (octave-6.4.0.tar.xz) = 633559d461a1bcadb70419620cb7321bac3de673984e689e140133eff6abcda9
+SHA512 (octave-6.4.0.tar.xz) = d239edde22877f0669314a66eb0d5ae787c387b1601a18e38d0b6971fe25b934801d1050679126974b716a6b7b27a3b51ecbfcff14a4ea529e51291f4028318b
+Size (octave-6.4.0.tar.xz) = 25354780 bytes
 SHA1 (patch-configure.ac) = 48a2dee11b33ce80a477367479ad348056c2c1f9
 SHA1 (patch-doc_interpreter_module.mk) = 66389cceddbe71fca0c8197275a839170d64ad5b
-SHA1 (patch-fseeko-fpos_t.c) = b38e7a38be2e0b323cd7f168f1d22d3df998691c
+SHA1 (patch-libgnu_fseeko.c) = b38e7a38be2e0b323cd7f168f1d22d3df998691c
 SHA1 (patch-libgnu_stdio.in.h) = 952e8683a70615b5219d034b9232420998cef44a
 SHA1 (patch-libinterp_dldfcn_config-module.awk) = 54b64357b1ef80c5e55eb5eccf742d2267eb277d
 SHA1 (patch-libinterp_dldfcn_module.mk) = 2362d824497a8892078437c24757ae1e40e2e556
 SHA1 (patch-liboctave_util_quit.cc) = 17ace431c53de1e5b72b86bb2bf4e15bdc6d4db9
-SHA1 (patch-liboctave_wrappers_iconv-wrappers.c) = e179580abfda1183dbf6c4768d9a92fde960e283
-SHA1 (patch-m4_acinclude.m4) = 2c5b2fc9bfe3b9b1e1feec805338ed92ed3953e1
+SHA1 (patch-m4_acinclude.m4) = 8d684f3036e25714738379156e766af9cd34afd8
 SHA1 (patch-scripts_miscellaneous_unpack.m) = 82c9ca170762e223c8e5a6f88a7dd9fe2a2a33d0
 SHA1 (patch-scripts_pkg_private_configure__make.m) = 7d4b620f889faa66c4c9c581ef8a7e7692b68c94
 SHA1 (patch-scripts_plot_util_____gnuplot__drawnow____.m) = 449b178aefd78c5c1b03ffd960f2e8be3874efc2

Index: pkgsrc/math/octave/patches/patch-m4_acinclude.m4
diff -u pkgsrc/math/octave/patches/patch-m4_acinclude.m4:1.3 pkgsrc/math/octave/patches/patch-m4_acinclude.m4:1.4
--- pkgsrc/math/octave/patches/patch-m4_acinclude.m4:1.3        Sun Apr 12 21:19:32 2020
+++ pkgsrc/math/octave/patches/patch-m4_acinclude.m4    Wed Dec 15 17:20:57 2021
@@ -1,4 +1,4 @@
-$NetBSD: patch-m4_acinclude.m4,v 1.3 2020/04/12 21:19:32 adam Exp $
+$NetBSD: patch-m4_acinclude.m4,v 1.4 2021/12/15 17:20:57 adam Exp $
 
 we pass and assume a given MACHINE_GNU_PLATFORM, but this package did not
 use this value due to an error.
@@ -10,9 +10,9 @@ Do not look for qcollectiongenerator; it
 
 On Darwin, do not produce a mach-o bundle.
 
---- m4/acinclude.m4.orig       2019-02-23 17:33:37.000000000 +0000
+--- m4/acinclude.m4.orig       2021-10-30 14:20:24.000000000 +0000
 +++ m4/acinclude.m4
-@@ -31,7 +31,7 @@ AC_DEFUN([OCTAVE_CANONICAL_HOST], [
+@@ -37,7 +37,7 @@ AC_DEFUN([OCTAVE_CANONICAL_HOST], [
      host=unknown-unknown-unknown
      AC_MSG_WARN([configuring Octave for unknown system type])
    fi
@@ -21,7 +21,7 @@ On Darwin, do not produce a mach-o bundl
    AC_SUBST(canonical_host_type)
    if test -z "$host_cpu"; then
      host_cpu=unknown
-@@ -2045,11 +2045,10 @@ AC_DEFUN([OCTAVE_CHECK_QT_VERSION], [AC_
+@@ -2496,11 +2496,10 @@ AC_DEFUN([OCTAVE_CHECK_QT_VERSION], [AC_
      OCTAVE_CHECK_QT_TOOL([uic])
      OCTAVE_CHECK_QT_TOOL([rcc])
      OCTAVE_CHECK_QT_TOOL([lrelease])
@@ -34,11 +34,11 @@ On Darwin, do not produce a mach-o bundl
        build_qt_gui=no
        MOC_QTVER=
        UIC_QTVER=
-@@ -2979,10 +2978,8 @@ AC_DEFUN_ONCE([OCTAVE_DEFINE_MKOCTFILE_D
+@@ -3523,10 +3522,8 @@ AC_DEFUN_ONCE([OCTAVE_DEFINE_MKOCTFILE_D
        SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'"
      ;;
      *-*-darwin*)
--      DL_LDFLAGS="-bundle -bundle_loader ${ac_top_build_prefix}libinterp/octave ${LDFLAGS}"
+-      DL_LDFLAGS="-bundle -bundle_loader ${ac_top_build_prefix}src/octave${EXEEXT} ${LDFLAGS}"
        dnl Contains variables that are defined and undefined at this point, so use
        dnl appropriate quoting to defer expansion of ${bindir} and ${version}.
 -      MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader ${bindir}/octave-${version}'"${EXEEXT}"

Added files:

Index: pkgsrc/math/octave/patches/patch-libgnu_fseeko.c
diff -u /dev/null pkgsrc/math/octave/patches/patch-libgnu_fseeko.c:1.1
--- /dev/null   Wed Dec 15 17:20:58 2021
+++ pkgsrc/math/octave/patches/patch-libgnu_fseeko.c    Wed Dec 15 17:20:57 2021
@@ -0,0 +1,40 @@
+$NetBSD: patch-libgnu_fseeko.c,v 1.1 2021/12/15 17:20:57 adam Exp $
+
+--- libgnu/fseeko.c.orig       2015-05-23 14:36:16.000000000 +0000
++++ libgnu/fseeko.c
+@@ -22,6 +22,9 @@
+ /* Get off_t, lseek, _POSIX_VERSION.  */
+ #include <unistd.h>
+ 
++/* mem* */
++#include <string.h>
++
+ #include "stdio-impl.h"
+ 
+ int
+@@ -132,19 +135,12 @@ fseeko (FILE *fp, off_t offset, int when
+       /* 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;



Home | Main Index | Thread Index | Old Index