Skip to content

Commit

Permalink
Workaround for conflicting definitions of __ssize_t in older mintlib …
Browse files Browse the repository at this point in the history
…headers
  • Loading branch information
th-otto committed Apr 29, 2020
1 parent 329612c commit 714818e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 4 additions & 0 deletions sources/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <mint/mintbind.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#ifndef _BITS_TYPES_H
#define _BITS_TYPES_H 1
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include "lib.h"
Expand Down
4 changes: 4 additions & 0 deletions sources/stat.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include <stdlib.h>
#include <osbind.h>
#include <errno.h>
#include <sys/types.h>
#ifndef _BITS_TYPES_H
#define _BITS_TYPES_H 1
#endif
#include <sys/stat.h>

#define X_MAGIC 0x601a
Expand Down

0 comments on commit 714818e

Please sign in to comment.