Type _off_t is always 32-bit, even on 64-bit platforms. Type _off64_t is
always 64-bit. So declare ftruncate(), ftruncate64(), truncate() and
truncate64() only once without checking for NO_OLDNAMES or _POSIX.
This simplify declaration of those functions in unistd.h header file.
---
mingw-w64-headers/crt/unistd.h | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/mingw-w64-headers/crt/unistd.h b/mingw-w64-headers/crt/unistd.h
index af59cb96ce20..dada951e5a8a 100644
--- a/mingw-w64-headers/crt/unistd.h
+++ b/mingw-w64-headers/crt/unistd.h
@@ -56,18 +56,6 @@ int __cdecl __MINGW_NOTHROW usleep(useconds_t);
#define FTRUNCATE_DEFINED
/* This is defined as a real library function to allow autoconf
to verify its existence. */
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
-int ftruncate(int, off32_t);
-int ftruncate64(int, off64_t);
-int truncate(const char *, off32_t);
-int truncate64(const char *, off64_t);
-#ifndef __CRT__NO_INLINE
-__CRT_INLINE int ftruncate(int __fd, off32_t __length)
-{
- return _chsize (__fd, __length);
-}
-#endif /* !__CRT__NO_INLINE */
-#else
int ftruncate(int, _off_t);
int ftruncate64(int, _off64_t);
int truncate(const char *, _off_t);
@@ -78,7 +66,6 @@ __CRT_INLINE int ftruncate(int __fd, _off_t __length)
return _chsize (__fd, __length);
}
#endif /* !__CRT__NO_INLINE */
-#endif
#endif /* FTRUNCATE_DEFINED */
#ifndef _FILE_OFFSET_BITS_SET_FTRUNCATE
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public