[Libguestfs] [PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.

Richard W.M. Jones rjones at redhat.com
Tue Feb 23 10:43:21 UTC 2016


On Tue, Feb 23, 2016 at 10:41:06AM +0000, Richard W.M. Jones wrote:
> On Tue, Feb 23, 2016 at 11:35:00AM +0100, Pino Toscano wrote:
> > On Tuesday 23 February 2016 09:17:42 Richard W.M. Jones wrote:
> > > Since the daemon links to pcre and use regular expressions, and since
> > > the COMPILE_REGEXP macro doesn't depend on any aspects of the
> > > library-side code (eg. the guestfs_h handle etc), we can allow the
> > > daemon to use the COMPILE_REGEXP macro.  Move the macro to
> > > "guestfs-internal-all.h" to permit this.
> > > ---
> > 
> > LGTM -- would you please move the <pcre.h> include from
> > guestfs-internal.h to guestfs-internal-all.h as well?
> 
> Good point, although maybe it's better not to include <pcre.h>
> everywhere and instead just include it in the C files where it is
> needed?

We need <pcre.h> in guestfs-internal.h, but we don't actually need it
in guestfs-internal-all.h (since it's only used by the COMPILE_REGEXP
macro).  Therefore I think it is better to leave it in
guestfs-internal.h.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list