diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-02-22 11:25:06 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-02-22 11:25:06 +0000 |
commit | 2e5790a97f21db8b175cdb8aa5721341649c4410 (patch) | |
tree | 719e96114f17ce8f664c9f5893d5211c36097ee8 /libgphoto2_port/libgphoto2_port | |
parent | 149b034ef8b19fb032602266723f7b67311ca598 (diff) | |
download | libgphoto2-2e5790a97f21db8b175cdb8aa5721341649c4410.tar.gz |
if we do not have regex.h, just do not regex matching
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14757 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/libgphoto2_port')
-rw-r--r-- | libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c index 5782c095e..d68073e0b 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c @@ -32,7 +32,7 @@ #ifdef HAVE_REGEX #include <regex.h> #else -#error We need regex.h, but it has not been detected. +#warning We need regex.h, but it has not been detected. #endif #include <ltdl.h> @@ -368,11 +368,13 @@ gp_port_info_list_lookup_path (GPPortInfoList *list, const char *path) unsigned int i; int result, generic; regex_t pattern; +#ifdef HAVE_REGEX #ifdef HAVE_GNU_REGEX const char *rv; #else regmatch_t match; #endif +#endif CHECK_NULL (list && path); @@ -390,6 +392,7 @@ gp_port_info_list_lookup_path (GPPortInfoList *list, const char *path) else if (!strcmp (list->info[i]->path, path)) return (i - generic); +#ifdef HAVE_REGEX /* Regex match? */ gp_log (GP_LOG_DEBUG, "gphoto2-port-info-list", _("Starting regex search for '%s'..."), path); @@ -452,6 +455,7 @@ gp_port_info_list_lookup_path (GPPortInfoList *list, const char *path) CR (result = gp_port_info_list_append (list, newinfo)); return result; } +#endif /* HAVE_REGEX */ return (GP_ERROR_UNKNOWN_PORT); } |