[Bf-blender-cvs] [532e29c] master: Win32: make DIR struct opaque
Campbell Barton
noreply at git.blender.org
Tue Jun 16 02:08:42 CEST 2015
Commit: 532e29cd76ba006db372f86e9c38c4d312d45fca
Author: Campbell Barton
Date: Tue Jun 16 09:40:17 2015 +1000
Branches: master
https://developer.blender.org/rB532e29cd76ba006db372f86e9c38c4d312d45fca
Win32: make DIR struct opaque
===================================================================
M source/blender/blenlib/BLI_winstuff.h
M source/blender/blenlib/intern/winstuff_dir.c
===================================================================
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index f40359e..8cf6f18 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -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);
diff --git a/source/blender/blenlib/intern/winstuff_dir.c b/source/blender/blenlib/intern/winstuff_dir.c
index b20da9c..30247f2 100644
--- a/source/blender/blenlib/intern/winstuff_dir.c
+++ b/source/blender/blenlib/intern/winstuff_dir.c
@@ -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()
More information about the Bf-blender-cvs
mailing list