mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
加上编译条件
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user