os2/SDL_sysfilesystem.c: use OS/2 api DosCreateDir() instead of mkdir(). mkdir() from watcom and emx differ - the latter being unix-ish, so this change avoids ifdefs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/src/filesystem/os2/SDL_sysfilesystem.c b/src/filesystem/os2/SDL_sysfilesystem.c
index 7fd09c0..dce3f28 100644
--- a/src/filesystem/os2/SDL_sysfilesystem.c
+++ b/src/filesystem/os2/SDL_sysfilesystem.c
@@ -29,8 +29,7 @@
#include "SDL_filesystem.h"
#include "../../core/os2/SDL_os2.h"
-#include <sys/types.h>
-#include <direct.h>
+#define INCL_DOSFILEMGR
#define INCL_DOSPROCESS
#define INCL_DOSERRORS
#include <os2.h>
@@ -75,7 +74,7 @@ SDL_GetPrefPath(const char *org, const char *app)
{
PSZ pszPath = SDL_getenv( "HOME" );
CHAR acBuf[_MAX_PATH];
- LONG lPosApp, lPosOrg;
+ int lPosApp, lPosOrg;
PSZ pszApp, pszOrg = OS2_UTF8ToSys( org );
if ( pszOrg == NULL )
@@ -93,10 +92,10 @@ SDL_GetPrefPath(const char *org, const char *app)
lPosApp = SDL_snprintf( acBuf, sizeof(acBuf) - 1, "%s\\%s", pszPath, pszOrg );
SDL_free( pszOrg );
- if ( lPosApp == -1 )
+ if ( lPosApp < 0 )
return NULL;
- mkdir( acBuf );
+ DosCreateDir( acBuf, NULL );
pszApp = OS2_UTF8ToSys( app );
if ( pszApp == NULL )
@@ -108,10 +107,10 @@ SDL_GetPrefPath(const char *org, const char *app)
lPosOrg = SDL_snprintf( &acBuf[lPosApp], sizeof(acBuf) - lPosApp - 1, "\\%s",
pszApp );
SDL_free( pszApp );
- if ( lPosOrg == -1 )
+ if ( lPosOrg < 0 )
return NULL;
- mkdir( acBuf );
+ DosCreateDir( acBuf, NULL );
*((PUSHORT)&acBuf[lPosApp + lPosOrg]) = (USHORT)'\0\\';
return OS2_SysToUTF8( acBuf );