File noregex.patch of Package libgphoto2

Index: configure.ac
===================================================================
--- libgphoto2_port/configure.ac	(revision 14756)
+++ libgphoto2_port/configure.ac	(working copy)
@@ -160,12 +160,7 @@
 dnl FIXME: Provide regex.h with the corresponding object code for 
 dnl        platforms which do not have it, e.g. Windows.
 AC_CHECK_HEADER([regex.h],
-                [AC_DEFINE([HAVE_REGEX],1,[whether we have regex.h])],
-		[AC_MSG_ERROR([
-*** We need regex.h and its object code to compile
-*** But we could not find it.
-])
-])
+                [AC_DEFINE([HAVE_REGEX],1,[whether we have regex.h])],[])
 
 dnl ---------------------------------------------------------------------------
 dnl Apple Bonjour / mDNSResponder multicast DNS queries.
Index: libgphoto2_port/gphoto2-port-info-list.c
===================================================================
--- libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c	(revision 14756)
+++ libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c	(working copy)
@@ -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 @@
 	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 @@
 		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 @@
 		CR (result = gp_port_info_list_append (list, newinfo));
 		return result;
 	}
+#endif /* HAVE_REGEX */
 
 	return (GP_ERROR_UNKNOWN_PORT);
 }
Index: libgphoto2_port/gphoto2/gphoto2-port.h
===================================================================
--- libgphoto2_port/gphoto2/gphoto2-port.h	(revision 14756)
+++ libgphoto2_port/gphoto2/gphoto2-port.h	(working copy)
@@ -33,7 +33,7 @@
 #include <os2.h>
 #endif
 
-#ifdef __cplusplus
+#if defined(__cplusplus) || defined(WIN32)
 extern "C" {
 #endif /* __cplusplus */
 
openSUSE Build Service is sponsored by