From da4d406dcb68d1de187d81c93ae50864cc3f8fb0 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Wed, 6 Jun 2007 12:38:07 +0200 Subject: mkdir.c (__gnat_mkdir): Add support for UTF-8. 2007-04-20 Pascal Obry * mkdir.c (__gnat_mkdir): Add support for UTF-8. From-SVN: r125434 --- gcc/ada/mkdir.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/mkdir.c b/gcc/ada/mkdir.c index 1aadf10..624a62c 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 +#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 -- cgit v1.1