Wireshark-dev: Re: [Wireshark-dev] Can I safely use PCRE in wiretap file reader?
From: Stephen Fisher <steve@xxxxxxxxxxxxxxxxxx>
Date: Sat, 18 Sep 2010 11:33:03 -0600
On Sat, Sep 18, 2010 at 01:14:37PM -0400, Hadriel Kaplan wrote:

> Since PCRE is "optional" in the dev docs, does that mean I can't 
> safely assume it's available in wireshark builds?

Yes, however, we recently started using GLib's GRegex functionality in 
place of PCRE when running a high-enough GLib version.  It's in GLib 
2.14 and higher:

http://library.gnome.org/devel/glib/unstable/glib-Perl-compatible-regular-expressions.html

You can block out your wiretap code to only work when compiled with GLib 
2.14 (which is most people, including all of the automated builds that 
people download) by using:

#if GLIB_CHECK_VERSION(2,14,0)
 ...
#endif

I don't see a problem with blocking out all of the new code, so that 
file format simply isn't available without GLib > 2.14.  That's how we 
usually handle new features (we don't show it unavailable in the GUI - 
it just doesn't show up at all).