forked from pyrite-dev/milsko
fix c89 discrepency
This commit is contained in:
parent
87f6dff101
commit
6a205453a7
1 changed files with 10 additions and 6 deletions
|
|
@ -68,13 +68,20 @@ void MwDirectoryClose(void* handle) {
|
|||
MwDirectoryEntry* MwDirectoryRead(void* handle) {
|
||||
dir_t* dir = handle;
|
||||
MwDirectoryEntry* entry = malloc(sizeof(*entry));
|
||||
if(!entry) {
|
||||
#ifdef _WIN32
|
||||
ULARGE_INTEGER* l;
|
||||
#elif defined(CLASSIC_MAC_OS)
|
||||
#else
|
||||
struct dirent* d;
|
||||
struct stat s;
|
||||
char* p;
|
||||
#endif
|
||||
|
||||
if(!entry) {
|
||||
printf("Out Of Memory\n");
|
||||
return NULL;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
ULARGE_INTEGER* l;
|
||||
|
||||
if(!dir->next) return NULL;
|
||||
|
||||
entry->name = MwStringDuplicate(dir->ffd.cFileName);
|
||||
|
|
@ -98,9 +105,6 @@ MwDirectoryEntry* MwDirectoryRead(void* handle) {
|
|||
#elif defined(CLASSIC_MAC_OS)
|
||||
/* todo */
|
||||
#else
|
||||
struct dirent* d;
|
||||
struct stat s;
|
||||
char* p;
|
||||
if((d = readdir(dir->dir)) == NULL) {
|
||||
free(entry);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue