Re: [PATCH] RTEMS: Define ssize_t for <dirent.h>

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Feb 23 06:49, Sebastian Huber wrote:
> This fixes the following build issue:
> 
> newlib/libc/include/dirent.h:84:1: error: unknown type name 'ssize_t'; did you mean '_ssize_t'?
>    84 | ssize_t posix_getdents(int, void *, size_t, int);
>       | ^~~~~~~
>       | _ssize_t
> ---
>  newlib/libc/sys/rtems/include/sys/dirent.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/newlib/libc/sys/rtems/include/sys/dirent.h b/newlib/libc/sys/rtems/include/sys/dirent.h
> index d44047fa5..6f8ff4278 100644
> --- a/newlib/libc/sys/rtems/include/sys/dirent.h
> +++ b/newlib/libc/sys/rtems/include/sys/dirent.h
> @@ -49,6 +49,11 @@ typedef	__off_t		off_t;
>  #define	_OFF_T_DECLARED
>  #endif
>  
> +#ifndef _SSIZE_T_DECLARED
> +typedef _ssize_t ssize_t;
> +#define	_SSIZE_T_DECLARED
> +#endif
> +
>  typedef struct _dirdesc {
>  	int	dd_fd;
>  	long	dd_loc;
> -- 
> 2.35.3

Sure, no worries!

Or would you rather like a __CYGWIN__ guard?


Corinna
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.