summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/clucene
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2009-08-13 13:52:51 (GMT)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2009-08-13 13:52:51 (GMT)
commita55a7e06727610683a61461adfd144046d669b46 (patch)
treebd57e73c4ec280c391b2fe517dc3d07098ca6441 /src/3rdparty/clucene
parentff01481900f1d19d392c8ed8fe0f3b5c85751b8e (diff)
downloadQt-a55a7e06727610683a61461adfd144046d669b46.zip
Qt-a55a7e06727610683a61461adfd144046d669b46.tar.gz
Qt-a55a7e06727610683a61461adfd144046d669b46.tar.bz2
clucene compiles on Windows CE now
reimplmenting some missing C functions Task-number: 214990 Reviewed-by: kh
Diffstat (limited to 'src/3rdparty/clucene')
-rw-r--r--src/3rdparty/clucene/src/CLucene/StdHeader.cpp2
-rw-r--r--src/3rdparty/clucene/src/CLucene/StdHeader.h10
-rw-r--r--src/3rdparty/clucene/src/CLucene/config/define_std.h3
-rw-r--r--src/3rdparty/clucene/src/CLucene/config/repl_tchar.h20
-rw-r--r--src/3rdparty/clucene/src/CLucene/util/Misc.cpp10
-rw-r--r--src/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp5
6 files changed, 50 insertions, 0 deletions
diff --git a/src/3rdparty/clucene/src/CLucene/StdHeader.cpp b/src/3rdparty/clucene/src/CLucene/StdHeader.cpp
index 9813a58..d64c51f 100644
--- a/src/3rdparty/clucene/src/CLucene/StdHeader.cpp
+++ b/src/3rdparty/clucene/src/CLucene/StdHeader.cpp
@@ -17,8 +17,10 @@
#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG)
# define CRTDBG_MAP_ALLOC
# include <stdlib.h>
+#ifndef UNDER_CE
# include <crtdbg.h>
#endif
+#endif
CL_NS_USE(util)
diff --git a/src/3rdparty/clucene/src/CLucene/StdHeader.h b/src/3rdparty/clucene/src/CLucene/StdHeader.h
index d267d03..fbb3fd9 100644
--- a/src/3rdparty/clucene/src/CLucene/StdHeader.h
+++ b/src/3rdparty/clucene/src/CLucene/StdHeader.h
@@ -58,8 +58,10 @@ extern int _lucene_counter_break; //can set a watch on this
#if defined(_CL_HAVE_UNISTD_H)
#include <unistd.h>
#elif defined(_CL_HAVE_IO_H) && defined(_CL_HAVE_DIRECT_H)
+#ifndef UNDER_CE
#include <io.h>
#include <direct.h>
+#endif
#else
#error "Neither unistd.h or (io.h & direct.h) were available"
#endif
@@ -75,7 +77,11 @@ extern int _lucene_counter_break; //can set a watch on this
#if defined(_CL_STAT_MACROS_BROKEN)
#error "Haven't implemented STAT_MACROS_BROKEN fix yet"
#elif defined(_CL_HAVE_SYS_STAT_H)
+#ifdef UNDER_CE
+ #include <types.h>
+#else
#include <sys/stat.h>
+#endif
#else
#error "Haven't implemented platforms with no sys/stat.h"
#endif
@@ -179,13 +185,17 @@ extern int _lucene_counter_break; //can set a watch on this
#include "CLucene/config/repl_tchar.h"
#if defined(_CL_HAVE_ERRNO_H)
+#ifndef UNDER_CE
#include <errno.h>
+#endif
#else
#error "Haven't implemented platforms with no errno.h"
#endif
#if defined(_CL_HAVE_FCNTL_H)
+#ifndef UNDER_CE
#include <fcntl.h>
+#endif
#else
#error "Haven't implemented platforms with no fcntl.h"
#endif
diff --git a/src/3rdparty/clucene/src/CLucene/config/define_std.h b/src/3rdparty/clucene/src/CLucene/config/define_std.h
index 3f92117..22a0790 100644
--- a/src/3rdparty/clucene/src/CLucene/config/define_std.h
+++ b/src/3rdparty/clucene/src/CLucene/config/define_std.h
@@ -72,6 +72,9 @@
#else
#define _CL_HAVE_UNISTD_H
#endif
+#ifdef UNDER_CE
+#undef _CL_HAVE_SYS_TIMEB_H
+#endif
////////////////////////////////////////////////
//now for individual functions. some compilers
diff --git a/src/3rdparty/clucene/src/CLucene/config/repl_tchar.h b/src/3rdparty/clucene/src/CLucene/config/repl_tchar.h
index d562cc8..ba8aef5 100644
--- a/src/3rdparty/clucene/src/CLucene/config/repl_tchar.h
+++ b/src/3rdparty/clucene/src/CLucene/config/repl_tchar.h
@@ -93,6 +93,26 @@
#endif
#else //HAVE_TCHAR_H
#include <tchar.h>
+
+#ifdef UNDER_CE
+#include <QString>
+#define _i64tot i64tot
+inline TCHAR* i64tot(__int64 value, TCHAR* str, int radix)
+{
+ QT_USE_NAMESPACE
+ _tcscpy(str, (TCHAR *) QString::number(value, radix).utf16());
+ return str;
+}
+
+#define _tcstoi64 tcstoi64
+inline __int64 tcstoi64(const TCHAR *nptr, TCHAR **endptr, int base)
+{
+ QT_USE_NAMESPACE
+ bool ok;
+ return QString::fromUtf16((ushort*) nptr).toInt(&ok, base);
+}
+
+#endif
//some tchar headers miss these...
#ifndef _tcstoi64
diff --git a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
index cb2efe2..42e3fd0 100644
--- a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
+++ b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
@@ -24,10 +24,15 @@
# include <sys/timeb.h>
#endif
+#ifdef UNDER_CE
+#include <QTime>
+#endif
+
CL_NS_DEF(util)
uint64_t Misc::currentTimeMillis()
{
+#ifndef UNDER_CE
#if defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) || defined(__BORLANDC__)
struct _timeb tstruct;
_ftime(&tstruct);
@@ -41,6 +46,11 @@ uint64_t Misc::currentTimeMillis()
return (((uint64_t) tstruct.tv_sec) * 1000) + tstruct.tv_usec / 1000;
#endif
+#else //UNDER_CE
+ QT_USE_NAMESPACE
+ QTime t = QTime::currentTime();
+ return t.second() * 1000 + t.msec();
+#endif //UNDER_CE
}
// #pragma mark -- char related utils
diff --git a/src/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp b/src/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp
index 3803dfd..9125d84 100644
--- a/src/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp
+++ b/src/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp
@@ -25,7 +25,10 @@
*/
#include "jstreamsconfig.h"
#include "fileinputstream.h"
+
+#ifndef UNDER_CE
#include <cerrno>
+#endif
#include <cstring>
namespace jstreams {
@@ -39,7 +42,9 @@ FileInputStream::FileInputStream(const char *filepath, int32_t buffersize) {
error = "Could not read file '";
error += filepath;
error += "': ";
+#ifndef UNDER_CE
error += strerror(errno);
+#endif
status = Error;
return;
}