Win32: make DIR struct opaque

This commit is contained in:
Campbell Barton 2015-06-16 09:40:17 +10:00
parent 291152e127
commit 532e29cd76
2 changed files with 15 additions and 11 deletions

View File

@ -132,17 +132,8 @@ struct dirent {
char *d_name;
};
typedef struct _DIR {
HANDLE handle;
WIN32_FIND_DATAW data;
char path[MAX_PATH];
long dd_loc;
long dd_size;
char dd_buf[4096];
void *dd_direct;
struct dirent direntry;
} DIR;
/* intentionally opaque to users */
typedef struct __dirstream DIR;
DIR *opendir(const char *path);
struct dirent *readdir(DIR *dp);

View File

@ -44,6 +44,19 @@
#include "BLI_utildefines.h"
#include "utfconv.h"
/* keep local to this file */
struct __dirstream {
HANDLE handle;
WIN32_FIND_DATAW data;
char path[MAX_PATH];
long dd_loc;
long dd_size;
char dd_buf[4096];
void *dd_direct;
struct dirent direntry;
};
/* Note: MinGW (FREE_WINDOWS) has opendir() and _wopendir(), and only the
* latter accepts a path name of wchar_t type. Rather than messing up with
* extra #ifdef's here and there, Blender's own implementations of opendir()