mkdir() fix for the winsim, should fix the red build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4269 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2004-01-23 11:36:02 +00:00
parent ef7293f0bc
commit 8e044b7856
4 changed files with 20 additions and 9 deletions

View file

@ -17,13 +17,10 @@
*
****************************************************************************/
#ifndef __FILE_WIN32_H__
#define __FILE_WIN32_H__
#define mkdir(x, y) dos_mkdir(x)
#ifndef __DIR_WIN32_H__
#define __DIR_WIN32_H__
#include <io.h>
#include "../../firmware/include/dir.h"
#endif // #ifndef __FILE_WIN32_H__
#endif // #ifndef __DIR_WIN32_H__

View file

@ -72,7 +72,7 @@ typedef struct DIRtag
extern DIR* opendir(char* name);
extern int closedir(DIR* dir);
extern int mkdir(char* name);
extern int mkdir(char* name, int mode);
extern struct dirent* readdir(DIR* dir);

View file

@ -38,6 +38,6 @@ int win32_filesize(int fd);
#include "../../firmware/include/file.h"
#undef rename
#define mkdir(x,y) win32_mkdir(x,y)
#endif

View file

@ -18,7 +18,6 @@
****************************************************************************/
#include <stdio.h>
#include "file.h"
#include "debug.h"
@ -47,3 +46,18 @@ int win32_filesize(int fd)
return(size);
}
extern (mkdir)(const char *name);
int win32_mkdir(const char *name, int mode)
{
char buffer[256]; /* sufficiently big */
(void)mode;
if(name[0] == '/') {
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
debugf("We create the real directory '%s'\n", buffer);
return (mkdir)(buffer);
}
return (mkdir)(name);
}