From e287ca9265fdcdf32409446d02a95579c0da8c1e Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 14 Jul 2008 22:26:38 +0300 Subject: [PATCH] 1030: Wrap get_search_region_from_search_nodes in #ifdef HAVE_REGEX_H This change avoids the following error: gcc -DHAVE_CONFIG_H -I../../.. -I/home/Kalle/src/elinks-0.11/src -I/home/Kalle/prefix/include -I/usr/include/smjs -I/usr/include -I/usr/include/lua50 -I/usr/include -I/usr/include -O0 -ggdb -Wall -Wall -Werror -fno-strict-aliasing -Wno-pointer-sign -Wno-address -fno-strict-overflow -o search.o -c /home/Kalle/src/elinks-0.11/src/viewer/text/search.c cc1: warnings being treated as errors /home/Kalle/src/elinks-0.11/src/viewer/text/search.c:257: warning: 'get_search_region_from_search_nodes' defined but not used make[3]: *** [search.o] Error 1 make[3]: Leaving directory `/home/Kalle/build/i686-pc-linux-gnu/elinks-0.11/src/viewer/text' get_search_region_from_search_nodes is called only from search_for_pattern, which already was inside #ifdef HAVE_REGEX_H. (cherry picked from commit 2aec302d4741ac27ce8e37de573030ca8bba727b) --- src/viewer/text/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index cde45828..4c0201e0 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -262,6 +262,7 @@ get_range(struct document *document, int y, int height, int l, return 0; } +#ifdef HAVE_REGEX_H /** Returns a string @c doc that is a copy of the text in the search * nodes from @a s1 to (@a s1 + @a doclen - 1) with the space at the * end of each line converted to a new-line character (LF). */ @@ -293,7 +294,6 @@ get_search_region_from_search_nodes(struct search *s1, struct search *s2, return doc; } -#ifdef HAVE_REGEX_H struct regex_match_context { struct search *s1; struct search *s2; -- 2.11.4.GIT