OSDN Git Service

2009-04-07 Emmanuel Briot <briot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Apr 2009 15:16:34 +0000 (15:16 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Apr 2009 15:16:34 +0000 (15:16 +0000)
* s-regexp.adb (Create_Mapping): Ignore excaped open parenthesis when
looking for the end of a parenthesis group

2009-04-07  Tristan Gingold  <gingold@adacore.com>

* gsocket.h Don't #include resolvLib.h if __RTP__ is defined.

* socket.c Don't use resolvLib_ macros if not defined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145680 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gsocket.h
gcc/ada/s-regexp.adb
gcc/ada/socket.c

index 7404808..d65d598 100644 (file)
@@ -1,3 +1,14 @@
+2009-04-07  Emmanuel Briot  <briot@adacore.com>
+
+       * s-regexp.adb (Create_Mapping): Ignore excaped open parenthesis when
+       looking for the end of a parenthesis group
+
+2009-04-07  Tristan Gingold  <gingold@adacore.com>
+
+       * gsocket.h Don't #include resolvLib.h if __RTP__ is defined.
+
+       * socket.c Don't use resolvLib_ macros if not defined.
+
 2009-04-07  Robert Dewar  <dewar@adacore.com>
 
        * g-socket.adb: Minor reformatting.
index 0dca1a9..5d866e0 100644 (file)
@@ -66,7 +66,9 @@
 #include <vxWorks.h>
 #include <ioLib.h>
 #include <hostLib.h>
+#ifndef __RTP__
 #include <resolvLib.h>
+#endif
 #define SHUT_RD                0
 #define SHUT_WR                1
 #define SHUT_RDWR      2
index 268ec21..37c189a 100755 (executable)
@@ -32,7 +32,6 @@
 ------------------------------------------------------------------------------
 
 with Ada.Unchecked_Deallocation;
---  with Ada.Exceptions;
 
 with System.Case_Util;
 
@@ -205,6 +204,7 @@ package body System.Regexp is
          J                 : Integer := S'First;
          Parenthesis_Level : Integer := 0;
          Curly_Level       : Integer := 0;
+         Last_Open         : Integer := S'First - 1;
 
       --  Start of processing for Create_Mapping
 
@@ -282,6 +282,7 @@ package body System.Regexp is
                when Open_Paren =>
                   if not Glob then
                      Parenthesis_Level := Parenthesis_Level + 1;
+                     Last_Open := J;
                   else
                      Add_In_Map (Open_Paren);
                   end if;
@@ -296,7 +297,7 @@ package body System.Regexp is
                            & "expression", J);
                      end if;
 
-                     if S (J - 1) = Open_Paren then
+                     if J = Last_Open + 1 then
                         Raise_Exception
                           ("Empty parenthesis not allowed in regular "
                            & "expression", J);
index 1716a96..86d054f 100644 (file)
@@ -352,22 +352,39 @@ __gnat_get_h_errno (void) {
     case 0:
       return 0;
 
+#ifdef S_resolvLib_HOST_NOT_FOUND
     case S_resolvLib_HOST_NOT_FOUND:
+#endif
     case S_hostLib_UNKNOWN_HOST:
+    case S_hostLib_HOST_NOT_FOUND:
       return HOST_NOT_FOUND;
 
+#ifdef S_resolvLib_TRY_AGAIN
     case S_resolvLib_TRY_AGAIN:
+#endif
+    case S_hostLib_TRY_AGAIN:
       return TRY_AGAIN;
 
+#ifdef S_resolvLib_NO_RECOVERY
     case S_resolvLib_NO_RECOVERY:
+#endif
+#ifdef S_resolvLib_BUFFER_2_SMALL
     case S_resolvLib_BUFFER_2_SMALL:
+#endif
+#ifdef S_resolvLib_INVALID_PARAMETER
     case S_resolvLib_INVALID_PARAMETER:
+#endif
+#ifdef S_resolvLib_INVALID_ADDRESS
     case S_resolvLib_INVALID_ADDRESS:
+#endif
     case S_hostLib_INVALID_PARAMETER:
+    case S_hostLib_NO_RECOVERY:
       return NO_RECOVERY;
 
+#ifdef S_resolvLib_NO_DATA
     case S_resolvLib_NO_DATA:
       return NO_DATA;
+#endif
 
     default:
       return -1;