From e545d1976cd98ff6bc92c443cac3fcbddf8d2a14 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Mon, 29 Jul 2013 09:18:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E7=BC=96=E8=AF=91=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/misc/dirent.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/misc/dirent.c b/src/misc/dirent.c index 69a35bc9..79a7115c 100644 --- a/src/misc/dirent.c +++ b/src/misc/dirent.c @@ -101,22 +101,34 @@ LCUI_API int LCUI_CloseDir( LCUI_Dir *dir_data ) char *LCUI_GetFileNameA( LCUI_DirEntry *entry ) { +#if defined (LCUI_BUILD_IN_WIN32) || (_WIN32) return entry->dataA.cFileName; +#endif + return NULL; } wchar_t *LCUI_GetFileNameW( LCUI_DirEntry *entry ) { +#if defined (LCUI_BUILD_IN_WIN32) || (_WIN32) return entry->dataW.cFileName; +#endif + return NULL; } int LCUI_FileIsDirectory( LCUI_DirEntry *entry ) { +#if defined (LCUI_BUILD_IN_WIN32) || (_WIN32) /* 由于entry是共用体,entry->dataA和entry->dataW的dwFileAttributes * 都是在同一内存空间,因此可直接用entry->dataA */ return entry->dataA.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; +#endif + return 0; } int LCUI_FileIsArchive( LCUI_DirEntry *entry ) { +#if defined (LCUI_BUILD_IN_WIN32) || (_WIN32) return entry->dataA.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE; +#endif + return 0; }