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) {
|
MwDirectoryEntry* MwDirectoryRead(void* handle) {
|
||||||
dir_t* dir = handle;
|
dir_t* dir = handle;
|
||||||
MwDirectoryEntry* entry = malloc(sizeof(*entry));
|
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");
|
printf("Out Of Memory\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
ULARGE_INTEGER* l;
|
|
||||||
|
|
||||||
if(!dir->next) return NULL;
|
if(!dir->next) return NULL;
|
||||||
|
|
||||||
entry->name = MwStringDuplicate(dir->ffd.cFileName);
|
entry->name = MwStringDuplicate(dir->ffd.cFileName);
|
||||||
|
|
@ -98,9 +105,6 @@ MwDirectoryEntry* MwDirectoryRead(void* handle) {
|
||||||
#elif defined(CLASSIC_MAC_OS)
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
/* todo */
|
/* todo */
|
||||||
#else
|
#else
|
||||||
struct dirent* d;
|
|
||||||
struct stat s;
|
|
||||||
char* p;
|
|
||||||
if((d = readdir(dir->dir)) == NULL) {
|
if((d = readdir(dir->dir)) == NULL) {
|
||||||
free(entry);
|
free(entry);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue