From 60ca8da9bac8217dd8cf253418650878c47b8af5 Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 20 Apr 2009 10:41:25 +0000 Subject: [PATCH] 2009-04-20 Gary Dismukes * osint-c.ads, osint-c.adb (Get_Object_Output_File_Name): New function to return the object file name saved by Set_Object_Output_File_Name. 2009-04-20 Emmanuel Briot * g-comlin.adb (Initialize_Option_Scan): Fix initialization of parsers for the standard command line, when argc has been modified since the start of the application. 2009-04-20 Thomas Quinot * socket.c (__gnat_inet_pton, Windows case): Adjust return value. WSAStringToAddress returns 0 for success and SOCKET_ERROR for failure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146395 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 16 ++++++++++++++++ gcc/ada/g-comlin.adb | 5 +++-- gcc/ada/osint-c.adb | 11 +++++++++++ gcc/ada/osint-c.ads | 4 ++++ gcc/ada/socket.c | 4 ++-- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ed49cb7..dbd869b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2009-04-20 Gary Dismukes + + * osint-c.ads, osint-c.adb (Get_Object_Output_File_Name): New function + to return the object file name saved by Set_Object_Output_File_Name. + +2009-04-20 Emmanuel Briot + + * g-comlin.adb (Initialize_Option_Scan): Fix initialization of parsers + for the standard command line, when argc has been modified since the + start of the application. + +2009-04-20 Thomas Quinot + + * socket.c (__gnat_inet_pton, Windows case): Adjust return value. + WSAStringToAddress returns 0 for success and SOCKET_ERROR for failure. + 2009-04-20 Bob Duff * gnat1drv.adb (Gnat1drv): Put call to Check_Library_Items inside diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index 8ee4f42..b010622 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -851,8 +851,9 @@ package body GNAT.Command_Line is if Command_Line = null then Parser := new Opt_Parser_Data (CL.Argument_Count); - Initialize_Option_Scan - (Switch_Char => Switch_Char, + Internal_Initialize_Option_Scan + (Parser => Parser, + Switch_Char => Switch_Char, Stop_At_First_Non_Switch => Stop_At_First_Non_Switch, Section_Delimiters => Section_Delimiters); else diff --git a/gcc/ada/osint-c.adb b/gcc/ada/osint-c.adb index e4dab2a..a93573e 100644 --- a/gcc/ada/osint-c.adb +++ b/gcc/ada/osint-c.adb @@ -236,6 +236,17 @@ package body Osint.C is end if; end Debug_File_Eol_Length; + --------------------------------- + -- Get_Output_Object_File_Name -- + --------------------------------- + + function Get_Output_Object_File_Name return String is + begin + pragma Assert (Output_Object_File_Name /= null); + + return Output_Object_File_Name.all; + end Get_Output_Object_File_Name; + ----------------------- -- More_Source_Files -- ----------------------- diff --git a/gcc/ada/osint-c.ads b/gcc/ada/osint-c.ads index 3c9cb69..1060934 100644 --- a/gcc/ada/osint-c.ads +++ b/gcc/ada/osint-c.ads @@ -32,6 +32,10 @@ package Osint.C is -- Called by the subprogram processing the command line when an -- output object file name is found. + function Get_Output_Object_File_Name return String; + -- Returns the name of the output object file as saved by a call to + -- Set_Output_Object_File_Name. Only valid to call if name has been set. + function More_Source_Files return Boolean; -- Indicates whether more source file remain to be processed. Returns -- False right away if no source files, or if all source files have diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 1c7de25..4633ebf 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -423,7 +423,7 @@ __gnat_inet_pton (int af, const char *src, void *dst) { ss.ss_family = af; rc = WSAStringToAddressA (src, af, NULL, (struct sockaddr *)&ss, &sslen); - if (rc > 0) { + if (rc == 0) { switch (af) { case AF_INET: *(struct in_addr *)dst = ((struct sockaddr_in *)&ss)->sin_addr; @@ -435,7 +435,7 @@ __gnat_inet_pton (int af, const char *src, void *dst) { #endif } } - return rc; + return (rc == 0); #endif } #endif -- 2.7.4