Files
gprbuild/examples/ada_cpp/src1/call_cpp.adb
Cyrille Comar bd096bfe99 add ada/c++ examples
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gprmake@43597 936e1b1b-40f2-da11-902a-00137254ae57
2007-04-10 13:28:19 +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;