diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:38:07 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:38:07 +0000 |
commit | 719e032b34c624e852c97de2887f1ad1ae88fa64 (patch) | |
tree | 52f94a2cfe7824ea097c03b09d80be513a79c143 /gcc/ada | |
parent | 1150cd7b3bb1af6974dd5ecfe5f1e370af074f84 (diff) | |
download | gcc-719e032b34c624e852c97de2887f1ad1ae88fa64.tar.gz |
2007-04-20 Pascal Obry <obry@adacore.com>
* mkdir.c (__gnat_mkdir): Add support for UTF-8.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/mkdir.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ada/mkdir.c b/gcc/ada/mkdir.c index 1aadf106ba1..624a62c06d2 100644 --- a/gcc/ada/mkdir.c +++ b/gcc/ada/mkdir.c @@ -6,7 +6,7 @@ * * * 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 * * terms of the GNU General Public License as published by the Free Soft- * @@ -44,6 +44,16 @@ #include "system.h" #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" /* This function provides a portable binding to the mkdir function. */ @@ -51,9 +61,13 @@ int __gnat_mkdir (char *dir_name) { -#if defined (_WIN32) || (defined (__vxworks) \ - && !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0))) +#if defined (__vxworks) && !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0)) 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 return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO); #endif |