Commit 6b44ae66 authored by yoogx's avatar yoogx

* Add preliminary support for C++

parent e60e4cd8
......@@ -2320,6 +2320,7 @@ package body Ocarina.Backends.C_Common.Mapping is
(Spec, Declarations, Statements);
when Subprogram_Opaque_C
| Subprogram_Opaque_CPP
| Subprogram_Default =>
-- Create function to lock the data.
......
......@@ -1535,7 +1535,6 @@ package body Ocarina.Backends.Properties is
when Language_SDL
| Language_SDL_RTDS
| Language_System_C
| Language_CPP
| Language_SDL_OpenGEODE
| Language_VHDL =>
-- A subprogram having this language as implementation
......@@ -1569,6 +1568,32 @@ package body Ocarina.Backends.Properties is
return Subprogram_Opaque_C;
end if;
when Language_CPP =>
if Src_Name /= No_Name or else Src_Files'Length > 0 then
if not Is_Empty (AIN.Calls (S)) and then
not Is_Empty (AIN.Subprogram_Calls
(AIN.First_Node (AIN.Calls (S))))
then
-- A subprogram having CPP as implementation
-- language, an implementation name and a *non
-- null* call sequence list is not supported yet.
return Subprogram_Unknown;
else
-- A subprogram having CPP as implementation
-- language, an implementation name and a *null*
-- call sequence list is an opaque C subprogram.
return Subprogram_Opaque_CPP;
end if;
else
-- A subprogram having CPP as implementation language
-- and a null source name and a null source text is a
-- wrong built subprogram.
return Subprogram_Opaque_CPP;
end if;
when Language_RTSJ =>
if Src_Name /= No_Name or else Src_Files'Length > 0 then
if not Is_Empty (AIN.Calls (S)) and then
......
......@@ -514,6 +514,7 @@ package Ocarina.Backends.Properties is
Subprogram_Opaque_Ada_95,
Subprogram_Opaque_Ada_95_Transfo,
Subprogram_Opaque_C,
Subprogram_Opaque_CPP,
Subprogram_Opaque_RTSJ,
Subprogram_Simulink,
Subprogram_Scade,
......
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