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:
parent
ef7293f0bc
commit
8e044b7856
4 changed files with 20 additions and 9 deletions
|
@ -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__
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue