Commit f7b458c3 authored by yoogx's avatar yoogx

* Recognize also .cpp as a valid C++ extension

parent cd210488
...@@ -667,14 +667,14 @@ package body Ocarina.Backends.Build_Utils is ...@@ -667,14 +667,14 @@ package body Ocarina.Backends.Build_Utils is
S_Name : Name_Id; S_Name : Name_Id;
Binding_Key : constant String := "%user_src_dir%"; Binding_Key : constant String := "%user_src_dir%";
begin begin
-- Ensure the user gives at most one source file (.cc) -- Ensure the user gives at most one source file (.cc or .cpp)
if Source_Files'Length > 1 if Source_Files'Length > 1
and then Get_Current_Backend_Kind = PolyORB_HI_Ada and then Get_Current_Backend_Kind = PolyORB_HI_Ada
then then
Display_Located_Error Display_Located_Error
(Loc (E), (Loc (E),
"more than one source files for a C subprogram", "more than one source files for a C++ subprogram",
Fatal => True); Fatal => True);
end if; end if;
...@@ -732,7 +732,9 @@ package body Ocarina.Backends.Build_Utils is ...@@ -732,7 +732,9 @@ package body Ocarina.Backends.Build_Utils is
Get_Name_String (Source_Basename); Get_Name_String (Source_Basename);
if Name_Buffer (Name_Len - 2 .. Name_Len) = ".cc" then if Name_Buffer (Name_Len - 2 .. Name_Len) = ".cc"
or else Name_Buffer (Name_Len - 3 .. Name_Len) = ".cpp"
then
Get_Name_String (Source_Dirname); Get_Name_String (Source_Dirname);
Get_Name_String_And_Append (Source_Basename); Get_Name_String_And_Append (Source_Basename);
...@@ -1204,11 +1206,11 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1204,11 +1206,11 @@ package body Ocarina.Backends.Build_Utils is
Handle_C_Source (E, Source_Name, Source_Files, M); Handle_C_Source (E, Source_Name, Source_Files, M);
when Subprogram_Opaque_CPP => when Subprogram_Opaque_CPP =>
-- If the subprogram is implemented by C source files, -- If the subprogram is implemented by CPP source
-- add the files to the C_Files list of the makefile -- files, add the files to the CPP_Files list of the
-- structure. If the subprogram is implemented by a C -- makefile structure. If the subprogram is
-- library, add the files to the C_Libraries list of -- implemented by a CPP library, add the files to the
-- the makefile structure. -- C_Libraries list of the makefile structure.
Handle_CPP_Source (E, Source_Name, Source_Files, M); Handle_CPP_Source (E, Source_Name, Source_Files, M);
...@@ -1514,7 +1516,6 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1514,7 +1516,6 @@ package body Ocarina.Backends.Build_Utils is
Name_Tables.First .. Name_Tables.Last (M.C_Objs) Name_Tables.First .. Name_Tables.Last (M.C_Objs)
loop loop
Write_Name (M.C_Objs.Table (J)); Write_Name (M.C_Objs.Table (J));
exit when J = Name_Tables.Last (M.C_Objs); exit when J = Name_Tables.Last (M.C_Objs);
Write_Line (" \"); Write_Line (" \");
...@@ -1764,7 +1765,7 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1764,7 +1765,7 @@ package body Ocarina.Backends.Build_Utils is
procedure Ada_C_Command_Line_Flags procedure Ada_C_Command_Line_Flags
(Ada_Sources : Name_Tables.Instance; (Ada_Sources : Name_Tables.Instance;
C_Sources : Name_Tables.Instance; C_Sources : Name_Tables.Instance;
CPP_Sources : Name_Tables.Instance; CPP_Sources : Name_Tables.Instance;
C_Libraries : Name_Tables.Instance) is C_Libraries : Name_Tables.Instance) is
begin begin
if Length (Ada_Sources) > 0 if Length (Ada_Sources) > 0
...@@ -1807,6 +1808,8 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1807,6 +1808,8 @@ package body Ocarina.Backends.Build_Utils is
end if; end if;
if Length (CPP_Sources) > 0 then if Length (CPP_Sources) > 0 then
Write_Line (" \");
Write_Str (ASCII.HT & " ");
for J in Name_Tables.First .. Name_Tables.Last (CPP_Sources) loop for J in Name_Tables.First .. Name_Tables.Last (CPP_Sources) loop
Get_Name_String (CPP_Sources.Table (J)); Get_Name_String (CPP_Sources.Table (J));
Set_Str_To_Name_Buffer Set_Str_To_Name_Buffer
......
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