This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

Re: [PATCH] Include "gdb_regex.h" instead of "gnu-regex.h"


   Date: Thu, 2 Aug 2001 16:29:13 -0400
   From: DJ Delorie <dj@redhat.com>

   Why not "xregex.h" ?

I'm working on that :-).  In fact replacing gnu-regex.{c,h} with
xregex.h is what prompted this change.  We will still need to go
through gdb_regex.h to support --without-included-regex though.

Before we can get rid of the regex code in the gdb subdirectory, there
is one problem to solve though.  GDB uses the BSD re_comp() and
re_exec() instead of the POSIX interfaces.  Unfortunately, that bit of
code isn't currently compiled into the code included in libiberty.

In the long run we probably want to switch to the POSIX interfaces,
but in the meantime, the attached patch would make it possible to use
"xregex.h" in GDB.  I think it is pretty harmless, although it does
involve some name-space pollution.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* xregex.h (_REGEX_RE_COMP): Define.
	(re_comp): Define to xre_comp.
	(re_exec): Define to xre_exec.

Index: xregex.h
===================================================================
RCS file: /cvs/src/src/include/xregex.h,v
retrieving revision 1.1
diff -u -p -r1.1 xregex.h
--- xregex.h 2001/07/11 00:15:17 1.1
+++ xregex.h 2001/08/02 20:57:19
@@ -19,6 +19,10 @@
 #  define re_syntax_options xre_syntax_options
 #  define re_max_failures xre_max_failures
 
+#  define _REGEX_RE_COMP
+#  define re_comp xre_comp
+#  define re_exec xre_exec
+
 #include "xregex2.h"
 
 #endif /* xregex.h */


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