Commit 34a5f838 authored by julien.delange's avatar julien.delange
Browse files

when an asn1 type is described in a data, remove the file suffix

and replace it with the .h extension



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@731 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent e1072fcd
......@@ -11,8 +11,12 @@ end ip;
bus implementation ip.pohic
end ip.pohic;
bus implementation ip.asn1
end ip.asn1;
bus implementation ip.i
subcomponents
asn : virtual bus asn1.i;
pohic : virtual bus pohi.c;
pohiada : virtual bus pohi.ada;
end ip.i;
bus implementation ip.pohiada
end ip.pohiada;
......
......@@ -90,6 +90,8 @@ end generic_serial.raw;
---------------------------------
device generic_sockets_ip
features
thebus : requires bus access ocarina_buses::ip.i;
end generic_sockets_ip;
device implementation generic_sockets_ip.pohic
......
......@@ -655,6 +655,7 @@ package body Ocarina.Backends.C_Common.Types is
declare
Source_Files : constant Name_Array
:= Get_Source_Text (E);
To_Include : Name_Id;
begin
if Source_Files'Length > 1 then
Display_Located_Error
......@@ -662,10 +663,18 @@ package body Ocarina.Backends.C_Common.Types is
"More than 1 header file for a C type",
Fatal => True);
elsif Source_Files'Length = 1 then
To_Include := Source_Files (Source_Files'First);
Get_Name_String (To_Include);
if Name_Buffer (Name_Len - 3 .. Name_Len)
= ".asn" then
Name_Len := Name_Len - 4;
To_Include := Name_Find;
end if;
Add_Include
(Make_Include_Clause
(Make_Defining_Identifier
(Source_Files (Source_Files'First), False)),
(To_Include, False)),
Preserve_Case => True);
end if;
end;
......
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