Commit da4d406d by Pascal Obry Committed by Arnaud Charlet

mkdir.c (__gnat_mkdir): Add support for UTF-8.

2007-04-20  Pascal Obry  <obry@adacore.com>

	* mkdir.c (__gnat_mkdir): Add support for UTF-8.

From-SVN: r125434
parent 66680f7a
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2002-2006, Free Software Foundation, Inc. * * Copyright (C) 2002-2007, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
...@@ -44,6 +44,16 @@ ...@@ -44,6 +44,16 @@
#include "system.h" #include "system.h"
#endif #endif
#ifdef __MINGW32__
#include "mingw32.h"
#include <windows.h>
#ifdef MAXPATHLEN
#define GNAT_MAX_PATH_LEN MAXPATHLEN
#else
#define GNAT_MAX_PATH_LEN 256
#endif
#endif
#include "adaint.h" #include "adaint.h"
/* This function provides a portable binding to the mkdir function. */ /* This function provides a portable binding to the mkdir function. */
...@@ -51,9 +61,13 @@ ...@@ -51,9 +61,13 @@
int int
__gnat_mkdir (char *dir_name) __gnat_mkdir (char *dir_name)
{ {
#if defined (_WIN32) || (defined (__vxworks) \ #if defined (__vxworks) && !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0))
&& !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0)))
return mkdir (dir_name); return mkdir (dir_name);
#elif defined (__MINGW32__)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSU (wname, dir_name, GNAT_MAX_PATH_LEN + 2);
return _tmkdir (wname);
#else #else
return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO); return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment