| Summary: | Compile error on Solaris 8 - kdepimlibs/kmime/kmime_util.cpp uses strcasestr which doesn't exist | ||
|---|---|---|---|
| Product: | [Applications] kontact | Reporter: | Steve Evans <stevee> |
| Component: | Assignee: | kdepim bugs <pim-bugs-null> | |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Solaris | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Steve Evans
2007-05-16 15:22:17 UTC
SVN commit 665647 by vkrause:
Build on systems without strcasestr().
The non-strcasestr code is not optimized at all and about 15x slower.
BUG: 145502
M +15 -14 CMakeLists.txt
M +2 -0 config-kmime.h.cmake
M +6 -0 kmime_util.cpp
--- trunk/KDE/kdepimlibs/kmime/CMakeLists.txt #665646:665647
@@ -5,28 +5,29 @@
)
include(CheckTimezone)
+check_function_exists(strcasestr HAVE_STRCASESTR)
configure_file (config-kmime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kmime.h)
########### next target ###############
set(kmime_LIB_SRCS
- kmime_charfreq.cpp
- kmime_util.cpp
- kmime_mdn.cpp
- kmime_codecs.cpp
- kmime_codec_base64.cpp
- kmime_codec_uuencode.cpp
- kmime_codec_qp.cpp
- kmime_codec_identity.cpp
- kmime_parsers.cpp
- kmime_header_parsing.cpp
+ kmime_charfreq.cpp
+ kmime_util.cpp
+ kmime_mdn.cpp
+ kmime_codecs.cpp
+ kmime_codec_base64.cpp
+ kmime_codec_uuencode.cpp
+ kmime_codec_qp.cpp
+ kmime_codec_identity.cpp
+ kmime_parsers.cpp
+ kmime_header_parsing.cpp
kmime_content.cpp
kmime_contentindex.cpp
- kmime_headers.cpp
- kmime_message.cpp
- kmime_newsarticle.cpp
+ kmime_headers.cpp
+ kmime_message.cpp
+ kmime_newsarticle.cpp
kmime_dateformatter.cpp
- boolflags.cpp
+ boolflags.cpp
kautodeletehash.cpp )
kde4_automoc(${kmime_LIB_SRCS})
--- trunk/KDE/kdepimlibs/kmime/config-kmime.h.cmake #665646:665647
@@ -4,3 +4,5 @@
/* Define if you have a tm_gmtoff member in struct tm */
#cmakedefine HAVE_TM_GMTOFF 1
+/* Define if strcasestr is available */
+#cmakedefine HAVE_STRCASESTR 1
--- trunk/KDE/kdepimlibs/kmime/kmime_util.cpp #665646:665647
@@ -38,6 +38,8 @@
#include "kmime_util.h"
#include "kmime_header_parsing.h"
+#include "config-kmime.h"
+
using namespace KMime;
namespace KMime {
@@ -350,11 +352,15 @@
pos1 = 0;
} else {
n.prepend('\n');
+#ifdef HAVE_STRCASESTR
const char* p = strcasestr( src.constData(), n.constData() );
if ( !p )
pos1 = -1;
else
pos1 = p - src.constData();
+#else
+ pos1 = src.toLower().indexOf( n.toLower() );
+#endif
}
if ( pos1 > -1) { //there is a header with the given name
|