Commit 3aa07c6d by Matt Kraai Committed by Matt Kraai

* bindgen.adb (Gen_Adafinal_C, Gen_Adainit_C, Gen_Elab_Defs_C)

	(Gen_Main_C, Gen_Output_File_C): Generate ISO C.

From-SVN: r67478
parent f1093866
2003-06-05 Matt Kraai <kraai@alumni.cmu.edu>
* bindgen.adb (Gen_Adafinal_C, Gen_Adainit_C, Gen_Elab_Defs_C)
(Gen_Main_C, Gen_Output_File_C): Generate ISO C.
2003-06-04 Matt Kraai <kraai@alumni.cmu.edu> 2003-06-04 Matt Kraai <kraai@alumni.cmu.edu>
* gnat_ug.texi (The GNAT Run-Time Library Builder gnatlbr): * gnat_ug.texi (The GNAT Run-Time Library Builder gnatlbr):
......
...@@ -232,7 +232,8 @@ package body Bindgen is ...@@ -232,7 +232,8 @@ package body Bindgen is
procedure Gen_Adafinal_C is procedure Gen_Adafinal_C is
begin begin
WBI ("void " & Ada_Final_Name.all & " () {"); WBI ("void " & Ada_Final_Name.all & " (void)");
WBI ("{");
WBI (" system__standard_library__adafinal ();"); WBI (" system__standard_library__adafinal ();");
WBI ("}"); WBI ("}");
WBI (""); WBI ("");
...@@ -472,7 +473,7 @@ package body Bindgen is ...@@ -472,7 +473,7 @@ package body Bindgen is
Main_Priority : Int renames ALIs.Table (ALIs.First).Main_Priority; Main_Priority : Int renames ALIs.Table (ALIs.First).Main_Priority;
begin begin
WBI ("void " & Ada_Init_Name.all & " ()"); WBI ("void " & Ada_Init_Name.all & " (void)");
WBI ("{"); WBI ("{");
-- Generate externals for elaboration entities -- Generate externals for elaboration entities
...@@ -821,7 +822,7 @@ package body Bindgen is ...@@ -821,7 +822,7 @@ package body Bindgen is
Set_Unit_Name; Set_Unit_Name;
Set_String ("___elab"); Set_String ("___elab");
Set_Char (Name_Buffer (Name_Len)); -- 's' or 'b' for spec/body Set_Char (Name_Buffer (Name_Len)); -- 's' or 'b' for spec/body
Set_String (" PARAMS ((void));"); Set_String (" (void);");
Write_Statement_Buffer; Write_Statement_Buffer;
end if; end if;
...@@ -1340,7 +1341,7 @@ package body Bindgen is ...@@ -1340,7 +1341,7 @@ package body Bindgen is
-- Normal case with command line arguments present -- Normal case with command line arguments present
else else
Set_String (" (argc, argv, envp)"); Set_String (" (int argc, char **argv, char **envp)");
end if; end if;
Write_Statement_Buffer; Write_Statement_Buffer;
...@@ -1357,9 +1358,6 @@ package body Bindgen is ...@@ -1357,9 +1358,6 @@ package body Bindgen is
-- Normal case of arguments present -- Normal case of arguments present
else else
WBI (" int argc;");
WBI (" char **argv;");
WBI (" char **envp;");
WBI ("{"); WBI ("{");
-- Generate a reference to __gnat_ada_main_program_name. This symbol -- Generate a reference to __gnat_ada_main_program_name. This symbol
...@@ -1984,30 +1982,22 @@ package body Bindgen is ...@@ -1984,30 +1982,22 @@ package body Bindgen is
Resolve_Binder_Options; Resolve_Binder_Options;
WBI ("#ifdef __STDC__"); WBI ("extern void __gnat_set_globals (int, int, int, int, int, int,");
WBI ("#define PARAMS(paramlist) paramlist"); WBI (" const char *, int, int, int);");
WBI ("#else"); WBI ("extern void " & Ada_Final_Name.all & " (void);");
WBI ("#define PARAMS(paramlist) ()"); WBI ("extern void " & Ada_Init_Name.all & " (void);");
WBI ("#endif");
WBI ("");
WBI ("extern void __gnat_set_globals ");
WBI (" PARAMS ((int, int, int, int, int, int, const char *,");
WBI (" int, int, int));");
WBI ("extern void " & Ada_Final_Name.all & " PARAMS ((void));");
WBI ("extern void " & Ada_Init_Name.all & " PARAMS ((void));");
WBI ("extern void system__standard_library__adafinal PARAMS ((void));"); WBI ("extern void system__standard_library__adafinal (void);");
if not No_Main_Subprogram then if not No_Main_Subprogram then
WBI ("extern int main PARAMS ((int, char **, char **));"); WBI ("extern int main (int, char **, char **);");
if Hostparm.OpenVMS then if Hostparm.OpenVMS then
WBI ("extern void __posix_exit PARAMS ((int));"); WBI ("extern void __posix_exit (int);");
else else
WBI ("extern void exit PARAMS ((int));"); WBI ("extern void exit (int);");
end if; end if;
WBI ("extern void __gnat_break_start PARAMS ((void));"); WBI ("extern void __gnat_break_start (void);");
Set_String ("extern "); Set_String ("extern ");
if ALIs.Table (ALIs.First).Main_Program = Proc then if ALIs.Table (ALIs.First).Main_Program = Proc then
...@@ -2018,14 +2008,14 @@ package body Bindgen is ...@@ -2018,14 +2008,14 @@ package body Bindgen is
Get_Name_String (Units.Table (First_Unit_Entry).Uname); Get_Name_String (Units.Table (First_Unit_Entry).Uname);
Set_Main_Program_Name; Set_Main_Program_Name;
Set_String (" PARAMS ((void));"); Set_String (" (void);");
Write_Statement_Buffer; Write_Statement_Buffer;
end if; end if;
if not No_Run_Time_Specified then if not No_Run_Time_Specified then
WBI ("extern void __gnat_initialize PARAMS ((void));"); WBI ("extern void __gnat_initialize (void);");
WBI ("extern void __gnat_finalize PARAMS ((void));"); WBI ("extern void __gnat_finalize (void);");
WBI ("extern void __gnat_install_handler PARAMS ((void));"); WBI ("extern void __gnat_install_handler (void);");
end if; end if;
WBI (""); WBI ("");
......
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