This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Generate ISO C for b_gnatb.c


Howdy,

I have committed the following patch.  It makes bindgen.adb
generate ISO C for b_gnatb.c.  It was bootstrapped on
powerpc-unknown-linux-gnu.

-- 
Matt Kraai <kraai@alumni.cmu.edu>
Debian GNU/Linux Peon

	* bindgen.adb (Gen_Adafinal_C, Gen_Adainit_C, Gen_Elab_Defs_C)
	(Gen_Main_C, Gen_Output_File_C): Generate ISO C.

Index: gcc/ada/bindgen.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/bindgen.adb,v
retrieving revision 1.10
diff -3 -c -p -r1.10 bindgen.adb
*** gcc/ada/bindgen.adb	24 Apr 2003 17:53:58 -0000	1.10
--- gcc/ada/bindgen.adb	4 Jun 2003 05:24:49 -0000
*************** package body Bindgen is
*** 232,238 ****
  
     procedure Gen_Adafinal_C is
     begin
!       WBI ("void " & Ada_Final_Name.all & " () {");
        WBI ("   system__standard_library__adafinal ();");
        WBI ("}");
        WBI ("");
--- 232,239 ----
  
     procedure Gen_Adafinal_C is
     begin
!       WBI ("void " & Ada_Final_Name.all & " (void)");
!       WBI ("{");
        WBI ("   system__standard_library__adafinal ();");
        WBI ("}");
        WBI ("");
*************** package body Bindgen is
*** 472,478 ****
        Main_Priority : Int renames ALIs.Table (ALIs.First).Main_Priority;
  
     begin
!       WBI ("void " & Ada_Init_Name.all & " ()");
        WBI ("{");
  
        --  Generate externals for elaboration entities
--- 473,479 ----
        Main_Priority : Int renames ALIs.Table (ALIs.First).Main_Priority;
  
     begin
!       WBI ("void " & Ada_Init_Name.all & " (void)");
        WBI ("{");
  
        --  Generate externals for elaboration entities
*************** package body Bindgen is
*** 821,827 ****
              Set_Unit_Name;
              Set_String ("___elab");
              Set_Char (Name_Buffer (Name_Len)); -- 's' or 'b' for spec/body
!             Set_String (" PARAMS ((void));");
              Write_Statement_Buffer;
           end if;
  
--- 822,828 ----
              Set_Unit_Name;
              Set_String ("___elab");
              Set_Char (Name_Buffer (Name_Len)); -- 's' or 'b' for spec/body
!             Set_String (" (void);");
              Write_Statement_Buffer;
           end if;
  
*************** package body Bindgen is
*** 1340,1346 ****
        --  Normal case with command line arguments present
  
        else
!          Set_String (" (argc, argv, envp)");
        end if;
  
        Write_Statement_Buffer;
--- 1341,1347 ----
        --  Normal case with command line arguments present
  
        else
!          Set_String (" (int argc, char **argv, char **envp)");
        end if;
  
        Write_Statement_Buffer;
*************** package body Bindgen is
*** 1357,1365 ****
        --  Normal case of arguments present
  
        else
-          WBI ("    int argc;");
-          WBI ("    char **argv;");
-          WBI ("    char **envp;");
           WBI ("{");
  
           --  Generate a reference to __gnat_ada_main_program_name. This symbol
--- 1358,1363 ----
*************** package body Bindgen is
*** 1984,2013 ****
  
        Resolve_Binder_Options;
  
!       WBI ("#ifdef __STDC__");
!       WBI ("#define PARAMS(paramlist) paramlist");
!       WBI ("#else");
!       WBI ("#define PARAMS(paramlist) ()");
!       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));");
  
        if not No_Main_Subprogram then
!          WBI ("extern int main PARAMS ((int, char **, char **));");
           if Hostparm.OpenVMS then
!             WBI ("extern void __posix_exit PARAMS ((int));");
           else
!             WBI ("extern void exit PARAMS ((int));");
           end if;
  
!          WBI ("extern void __gnat_break_start PARAMS ((void));");
           Set_String ("extern ");
  
           if ALIs.Table (ALIs.First).Main_Program = Proc then
--- 1982,2003 ----
  
        Resolve_Binder_Options;
  
!       WBI ("extern void __gnat_set_globals (int, int, int, int, int, int,");
!       WBI ("                                const char *, int, int, int);");
!       WBI ("extern void " & Ada_Final_Name.all & " (void);");
!       WBI ("extern void " & Ada_Init_Name.all & " (void);");
  
!       WBI ("extern void system__standard_library__adafinal (void);");
  
        if not No_Main_Subprogram then
!          WBI ("extern int main (int, char **, char **);");
           if Hostparm.OpenVMS then
!             WBI ("extern void __posix_exit (int);");
           else
!             WBI ("extern void exit (int);");
           end if;
  
!          WBI ("extern void __gnat_break_start (void);");
           Set_String ("extern ");
  
           if ALIs.Table (ALIs.First).Main_Program = Proc then
*************** package body Bindgen is
*** 2018,2031 ****
  
           Get_Name_String (Units.Table (First_Unit_Entry).Uname);
           Set_Main_Program_Name;
!          Set_String (" PARAMS ((void));");
           Write_Statement_Buffer;
        end if;
  
        if not No_Run_Time_Specified then
!          WBI ("extern void __gnat_initialize PARAMS ((void));");
!          WBI ("extern void __gnat_finalize PARAMS ((void));");
!          WBI ("extern void __gnat_install_handler PARAMS ((void));");
        end if;
  
        WBI ("");
--- 2008,2021 ----
  
           Get_Name_String (Units.Table (First_Unit_Entry).Uname);
           Set_Main_Program_Name;
!          Set_String (" (void);");
           Write_Statement_Buffer;
        end if;
  
        if not No_Run_Time_Specified then
!          WBI ("extern void __gnat_initialize (void);");
!          WBI ("extern void __gnat_finalize (void);");
!          WBI ("extern void __gnat_install_handler (void);");
        end if;
  
        WBI ("");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]