view src/stable-octave-1-gnulib.patch @ 5278:db215107402f

Add lseek patch for gnulib * src/default-octave-1-gnulib.patch, src/release-octave-1-gnulib.patch, src/stable-octave-1-gnulib.patch: patch lseek
author John Donoghue <john.donoghue@ieee.org>
date Sun, 26 Jan 2020 08:04:12 -0500
parents e622765c49c7
children
line wrap: on
line source

diff -uNr a/libgnu/unistd.in.h b/libgnu/unistd.in.h
--- a/libgnu/unistd.in.h	2016-06-18 18:47:32.000000000 -0400
+++ b/libgnu/unistd.in.h	2016-06-23 18:45:42.410781867 -0400
@@ -734,7 +734,7 @@
    Null terminate it if the name is shorter than LEN.
    If the host name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
-# if @UNISTD_H_HAVE_WINSOCK2_H@
+# if !@HAVE_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef gethostname
 #   define gethostname rpl_gethostname

diff -u a/libgnu/lseek.c b/libgnu/lseek.c
--- a/libgnu/lseek.c    2020-01-25 23:41:47.321133728 -0500
+++ b/libgnu/lseek.c    2020-01-25 23:43:05.587623161 -0500
@@ -63,7 +63,7 @@
       return -1;
     }
 #endif
-#if _GL_WINDOWS_64_BIT_OFF_T
+#if _GL_WINDOWS_64_BIT_OFF_T || (defined __MINGW32__ && defined _FILE_OFFSET_BITS && (_FILE_OFFSET_BITS == 64))
   return _lseeki64 (fd, offset, whence);
 #else
   return lseek (fd, offset, whence)