diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 09:30:39 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 09:30:39 +0000 |
commit | 3b18b370fc006dded92a40315801ad42345139fb (patch) | |
tree | ff53725d708aacac9be1a454735ad7f7bd86d8f1 /gcc/ada/g-os_lib.adb | |
parent | 11ef74b2c6516991c7aeda4361c1a01c936d6444 (diff) | |
download | gcc-3b18b370fc006dded92a40315801ad42345139fb.tar.gz |
2006-02-13 Pascal Obry <obry@adacore.com>
Nicolas Roche <roche@adacore.com>
Arnaud Charlet <charlet@adacore.com>
* adaint.h, adaint.c (DIR_SEPARATOR): Use _T() macro for Unicode
support.
(__gnat_try_lock): Add unicode support by using a specific section on
Windows.
(__gnat_get_current_dir): Idem.
(__gnat_open_read): Idem.
(__gnat_open_rw): Idem.
(__gnat_open_create): Idem.
(__gnat_create_output_file): Idem.
(__gnat_open_append): Idem.
(__gnat_open_new): Idem.
(__gnat_file_time_name): Idem.
(__gnat_set_file_time_name): Idem.
(__gnat_stat): Idem.
(win32_no_block_spawn): Idem.
(__gnat_locate_exec_on_path): Idem.
(__gnat_opendir): New routine.
(__gnat_closedir): Idem.
(__gnat_readdir): Add new parameter length (pointer to int). Update
implementation to use it and add specific Win32 code for Unicode
support.
(__gnat_get_env_value_ptr): Remove. Replaced by __gnat_getenv in env.c
(__gnat_set_env_value): Remove. Replaced by __gnat_setenv in env.c
(convert_addresses): Do not define this dummy routine on VMS.
* mingw32.h (GNAT_UNICODE_SUPPORT): New definition, if set the GNAT
runtime Unicode support will be activated.
(S2WS): String to Wide-String conversion. This version just copy a
string in non Unicode version.
(WS2S): Wide-String to String conversion. This version just copy a
string in non Unicode version.
* g-dirope.adb: (Close): Now import __gnat_closedir from adaint.c.
(Open): Now import __gnat_opendir from adaint.c.
(Read): Change the implementation to support unicode characters. It is
not possible to use strlen() on Windows as this version supports only
standard ASCII characters. So the length of the directory entry is now
returned from the imported __gnat_readdir routine.
Update copyright notice.
* s-crtl-vms64.ads, s-crtl.ads: (closedir): Moved to adaint.c.
(opendir): Moved to adaint.c.
* g-os_lib.adb (Copy_Time_Stamp): Fix off-by-one range computation.
(Get_Directory): Fix wrong indexing.
(Getenv): replace __gnat_get_env_value_ptr from adaint.c by
__gnat_getenv from env.c
(Setenv): replace __gnat_set_env_value from adaint.c by __gnat_setenv
from env.c
* env.h, env.c: New file.
* s-scaval.adb (Initialize): Replace __gnat_get_env_value_ptr from
adaint.c by __gnat_getenv from env.c
* s-shasto.adb (Initialize): replace __gnat_get_env_value_ptr from
adaint.c by __gnat_getenv from env.c
* Make-lang.in: Add env.o in the list of C object needed by gnat1
and gnatbind.
Update dependencies.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-os_lib.adb')
-rw-r--r-- | gcc/ada/g-os_lib.adb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb index 46a21fdf750..dbfc6b91745 100644 --- a/gcc/ada/g-os_lib.adb +++ b/gcc/ada/g-os_lib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1995-2005, AdaCore -- +-- Copyright (C) 1995-2006, AdaCore -- -- -- -- 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- -- @@ -609,11 +609,11 @@ package body GNAT.OS_Lib is C_Source : String (1 .. Source'Length + 1); C_Dest : String (1 .. Dest'Length + 1); begin - C_Source (1 .. C_Source'Length) := Source; - C_Source (C_Source'Last) := ASCII.Nul; + C_Source (1 .. Source'Length) := Source; + C_Source (C_Source'Last) := ASCII.NUL; - C_Dest (1 .. C_Dest'Length) := Dest; - C_Dest (C_Dest'Last) := ASCII.Nul; + C_Dest (1 .. Dest'Length) := Dest; + C_Dest (C_Dest'Last) := ASCII.NUL; if Copy_Attributes (C_Source'Address, C_Dest'Address, 0) = -1 then Success := False; @@ -1057,7 +1057,7 @@ package body GNAT.OS_Lib is function Getenv (Name : String) return String_Access is procedure Get_Env_Value_Ptr (Name, Length, Ptr : Address); - pragma Import (C, Get_Env_Value_Ptr, "__gnat_get_env_value_ptr"); + pragma Import (C, Get_Env_Value_Ptr, "__gnat_getenv"); procedure Strncpy (Astring_Addr, Cstring : Address; N : Integer); pragma Import (C, Strncpy, "strncpy"); @@ -1702,12 +1702,11 @@ package body GNAT.OS_Lib is -- Directory given, add directory separator if needed if Dir'Length > 0 then - if Dir (Dir'Length) = Directory_Separator then + if Dir (Dir'Last) = Directory_Separator then return Directory; else declare Result : String (1 .. Dir'Length + 1); - begin Result (1 .. Dir'Length) := Dir; Result (Result'Length) := Directory_Separator; @@ -2313,7 +2312,7 @@ package body GNAT.OS_Lib is F_Value : String (1 .. Value'Length + 1); procedure Set_Env_Value (Name, Value : System.Address); - pragma Import (C, Set_Env_Value, "__gnat_set_env_value"); + pragma Import (C, Set_Env_Value, "__gnat_setenv"); begin F_Name (1 .. Name'Length) := Name; |