Cygwin: dirent.h: make definition of struct __DIR opaque
The content of DIR should never have been exposed into userspace. Move struct __DIR to local dirent.h and only keep forward declaration in exported dirent.h. This allows to tweak the structure in future, for instance, to add thread-safety. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
d72be712aa
commit
5353cb8ef8
|
@ -1,4 +1,4 @@
|
|||
/* Posix dirent.h for WIN32.
|
||||
/* Posix dirent.h
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
|
@ -41,21 +41,7 @@ struct dirent
|
|||
|
||||
#define d_fileno d_ino /* BSD compatible definition */
|
||||
|
||||
#define __DIRENT_COOKIE 0xcdcd8484
|
||||
|
||||
typedef struct __DIR
|
||||
{
|
||||
/* This is first to set alignment in non _LIBC case. */
|
||||
unsigned long __d_cookie;
|
||||
struct dirent *__d_dirent;
|
||||
char *__d_dirname; /* directory name with trailing '*' */
|
||||
__int32_t __d_position; /* used by telldir/seekdir */
|
||||
int __d_fd;
|
||||
uintptr_t __d_internal;
|
||||
void *__handle;
|
||||
void *__fh;
|
||||
unsigned __flags;
|
||||
} DIR;
|
||||
typedef struct __DIR DIR;
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#ifdef _DIRENT_HAVE_D_TYPE
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/* dirent.h: define struct __DIR
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#ifndef _CYGWIN_DIRENT_H
|
||||
#define _CYGWIN_DIRENT_H
|
||||
|
||||
#include_next <dirent.h>
|
||||
|
||||
#define __DIRENT_COOKIE 0xcdcd8484
|
||||
|
||||
struct __DIR
|
||||
{
|
||||
/* This is first to set alignment in non _LIBC case. */
|
||||
unsigned long __d_cookie;
|
||||
struct dirent *__d_dirent;
|
||||
char *__d_dirname; /* directory name with trailing '*' */
|
||||
__int32_t __d_position; /* used by telldir/seekdir */
|
||||
int __d_fd;
|
||||
uintptr_t __d_internal;
|
||||
void *__handle;
|
||||
void *__fh;
|
||||
unsigned __flags;
|
||||
};
|
||||
|
||||
#endif /* _CYGWIN_DIRENT_H */
|
Loading…
Reference in New Issue