aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-files_operations.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-13 17:02:45 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-13 17:02:45 +0200
commit0aac4efd094b6b7ec0254f2bc4c2b994ed35c417 (patch)
tree7eafc1378abe8336cf79d0aa3b7fd0398a2b0107 /src/grt/grt-files_operations.adb
parent25b2dfe55c659ac84e54b0db82dff2461d9bd286 (diff)
downloadghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.tar.gz
ghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.tar.bz2
ghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.zip
synth: also try to open files (during synthesis) relative to current unit.
Fix #1190
Diffstat (limited to 'src/grt/grt-files_operations.adb')
-rw-r--r--src/grt/grt-files_operations.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/grt/grt-files_operations.adb b/src/grt/grt-files_operations.adb
index b1f504dc9..a98579bb7 100644
--- a/src/grt/grt-files_operations.adb
+++ b/src/grt/grt-files_operations.adb
@@ -249,6 +249,12 @@ package body Grt.Files_Operations is
return;
end Ghdl_File_Endfile;
+ function Simple_Open (Name : Ghdl_C_String; Mode : Ghdl_C_String)
+ return C_Files is
+ begin
+ return fopen (To_Address (Name), To_Address (Mode));
+ end Simple_Open;
+
Sig_Header : constant String := "#GHDL-BINARY-FILE-0.0" & Nl;
Std_Output_Name : constant String := "STD_OUTPUT" & NUL;
@@ -309,7 +315,7 @@ package body Grt.Files_Operations is
Str_Mode (2) := 'b';
Str_Mode (3) := NUL;
end if;
- F := fopen (To_Address (Name), Str_Mode'Address);
+ F := Open_Handler (Name, To_Ghdl_C_String (Str_Mode'Address));
if F = NULL_Stream then
Status := Op_Name_Error;
return;