From 714818e7ba2a44466219c7361a5deb77dd00fa53 Mon Sep 17 00:00:00 2001 From: Thorsten Otto Date: Tue, 28 Apr 2020 16:01:44 +0200 Subject: [PATCH] Workaround for conflicting definitions of __ssize_t in older mintlib headers --- include/sys/types.h | 16 ++++++++++++++++ sources/open.c | 4 ++++ sources/stat.c | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/include/sys/types.h b/include/sys/types.h index 7b943c8..f5d85fe 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -21,10 +21,26 @@ typedef signed long long int __int64_t; typedef unsigned long long int __uint64_t; #endif /* GNUC */ +#ifdef __GNUC__ +typedef unsigned long long int __u_quad_t; +typedef long long int __quad_t; +#else +typedef struct +{ + long __val[2]; +} __quad_t; +typedef struct +{ + __u_long __val[2]; +} __u_quad_t; +#endif /* GNUC */ +typedef __quad_t __dev_t; /* Type of device numbers. */ + typedef __uint32_t __uid_t; /* Type of user identifications. */ typedef __uint32_t __gid_t; /* Type of group identifications. */ typedef __uint32_t __ino_t; /* Type of file serial numbers. */ typedef __uint32_t __mode_t; /* Type of file attribute bitmasks. */ +typedef __uint32_t __nlink_t; /* Type of file link counts. */ typedef signed long int __ssize_t; /* Type of a byte count, or error. */ typedef __int32_t __off_t; /* Type of file sizes and offsets. */ typedef __int32_t __clock_t; /* Type of CPU usage counts. */ diff --git a/sources/open.c b/sources/open.c index 5aeb4a0..7cc9d63 100644 --- a/sources/open.c +++ b/sources/open.c @@ -4,6 +4,10 @@ #include #include #include +#include +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 +#endif #include #include #include "lib.h" diff --git a/sources/stat.c b/sources/stat.c index 950340e..6ee5ce0 100644 --- a/sources/stat.c +++ b/sources/stat.c @@ -1,6 +1,10 @@ #include #include #include +#include +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 +#endif #include #define X_MAGIC 0x601a