aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/bindgen.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-17 10:51:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-17 10:51:43 +0200
commitee00428abe9c842a945773db80cf00471184e9c8 (patch)
treed2d00eb089777564d8460482a6172c033e79d9df /gcc/ada/bindgen.adb
parentd23a572fca4b29667c9758192d769ff5e34efe33 (diff)
downloadgcc-ee00428abe9c842a945773db80cf00471184e9c8.zip
gcc-ee00428abe9c842a945773db80cf00471184e9c8.tar.gz
gcc-ee00428abe9c842a945773db80cf00471184e9c8.tar.bz2
[multiple changes]
2009-04-17 Pascal Obry <obry@adacore.com> * adaint.h, argv.c (__gnat_init_args): New routine used to initialize command line arguments. * bindgen.adb: Call __gnat_init_args instead of simple assignments of argc, argv and envp parameters. * init.c: Fix minor typo and style fix. 2009-04-17 Nicolas Setton <setton@adacore.com> * link.c: Add darwin section From-SVN: r146224
Diffstat (limited to 'gcc/ada/bindgen.adb')
-rw-r--r--gcc/ada/bindgen.adb37
1 files changed, 31 insertions, 6 deletions
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index ce81c7a..ef90c6c 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -1456,6 +1456,17 @@ package body Bindgen is
WBI (" is");
+ -- ??? the following code needs commenting
+
+ if not Configurable_Run_Time_Mode then
+ WBI (" procedure Init_Args");
+ WBI (" (argc : Integer;");
+ WBI (" argv : System.Address;");
+ WBI (" envp : System.Address);");
+ WBI (" pragma Import (C, Init_Args, ""__gnat_init_args"");");
+ WBI ("");
+ end if;
+
else
if Exit_Status_Supported_On_Target then
Set_String (" return Integer is");
@@ -1569,9 +1580,16 @@ package body Bindgen is
-- Acquire command line arguments if present on target
if Command_Line_Args_On_Target then
- WBI (" gnat_argc := argc;");
- WBI (" gnat_argv := argv;");
- WBI (" gnat_envp := envp;");
+ if Configurable_Run_Time_Mode then
+ WBI (" gnat_argc := argc;");
+ WBI (" gnat_argv := argv;");
+ WBI (" gnat_envp := envp;");
+
+ -- ??? this else needs a comment
+ else
+ WBI (" Init_Args (argc, argv, envp);");
+ end if;
+
WBI ("");
-- If configurable run time and no command line args, then nothing
@@ -1732,9 +1750,16 @@ package body Bindgen is
-- arguments are present on target
if Command_Line_Args_On_Target then
- WBI (" gnat_argc = argc;");
- WBI (" gnat_argv = argv;");
- WBI (" gnat_envp = envp;");
+ if Configurable_Run_Time_Mode then
+ WBI (" gnat_argc = argc;");
+ WBI (" gnat_argv = argv;");
+ WBI (" gnat_envp = envp;");
+
+ -- ??? this call must be commented
+ else
+ WBI (" __gnat_init_args (argc, argv, envp);");
+ end if;
+
WBI (" ");
-- If configurable run-time, then nothing to do, since in this case