Files
gpr/examples/gprbuild/ada_cpp/src1/call_cpp.adb
Jerome Lambourg 76c10c296d Add the examples from the gprbuild repository
Adjust the project files to properly install them in share/doc

For eng/gpr/gpr-issues#548
2025-03-10 16:16:29 +00:00

24 lines
460 B
Ada

with Text_IO; use Text_IO;
procedure Call_CPP is
procedure cpp_routine;
pragma Import (C, cpp_routine);
Error : exception;
procedure Raise_And_Catch is
begin
Put ("in Ada: raise ... ");
raise Error;
exception
when Error =>
Put_Line ("and catch!");
end Raise_And_Catch;
begin
Put_Line ("In Call_CPP");
Raise_And_Catch;
cpp_routine;
Put_Line ("Back in Call_CPP");
Raise_And_Catch;
end Call_CPP;