Hi,
sorry for my late answer. I was on holiday.
we are very interested in adopting openzim wherever possible. A nice handheld
device or phone would be a great showcase and of.
The ZimReader actually was once compiled on a openmoko device and it worked.
How can we help?
Tommi
On Mittwoch, 22. Juli 2009 17:49:42 you wrote:
> Hi Tommi,
>
> Sorry for using your tntnet address for an OpenZim related mail :)
>
> I am Mirko and part of the Qi Hardware Team.
>
> This Monday we launched our company [1] and announced our first product
> "Ben NanoNote", a fully opened multifunction device [3].
>
> As you can see on the product page the Ben NanoNote does not have a
> build-in RF chip. We therefore think it would be ideal for a project such
> as OpenZim and as a device for an offline version of Wikipedia.
>
> We are very interested to hear what you thoughts are. We have a mailing
> list dedicated for development [3].
>
> We see an OpenZim client as a possibility for one of the standard
> applications shipping in our image, but would need guidance. If you think
> this would be doable and something you would be interested in, let me know.
>
> Regards,
> /Mirko
>
>
> [1]
> http://linux.com/news/embedded-mobile/mids/29263-openmoko-layoffs-lead-to-n
>ew-open-hardware-venture [2]
> http://www.qi-hardware.com/products/ben-nanonote/
> [3] http://lists.qi-hardware.com/cgi-bin/mailman/listinfo/developer
Hi all!
Since an offline encyclopedia is most valuable on mobile
devices, I worked on building ZimReader for the Openmoko
Neo.
As a start I did a native build on a Debian (hackable:1 [3])
driven Openmoko Freerunner. After fixing some minor build
issue ([1], [2]), I can now browse Wikipedia offline on the
phone.
ZimReader performs amazingly well on the limited resources
of the device. I use it in conjunction with woosh, a browser
that comes with hackable:1. The content resides on SD-card.
A full-text search takes around 5s, mostly even less.
Since I'm not too much into packaging, I wrapped up a tar
ball for those interested in binaries [4]. Please see the
Readme for installation instructions.
Note: The binaries will most likely _not_ run on OE-based
distributions (OM2009, SHR). They have only been tested
on hackable1. I'll try to supply packages for other distros, as
soon as I find the time.
Thank's a lot to the openzim team for their great work!
Cheers, Marc
[1] http://bugs.openzim.org/show_bug.cgi?id=6
[2] http://bugs.openzim.org/show_bug.cgi?id=5
[3] http://www.hackable1.org/wiki/Main_Page
[4] http://www.gut-informierte-kreise.de/openmoko/openzim/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I have achieved to compile a first version of a zimlib.lib (static
library under Windows). I do not really know if I can use it... but at
least it compiles.
I want to give you here the modifications I have done to achieve that.
Tommi, it would be great to include them (or others with the same
purpose) into the SVN.
Index: include/zim/zim.h
===================================================================
- --- include/zim/zim.h (revision 236)
+++ include/zim/zim.h (working copy)
@@ -22,6 +22,12 @@
#include <stdint.h>
+#ifdef _WIN32
+typedef unsigned __int64 uint64_t;
+typedef signed __int8 int8_t;
+typedef signed __int32 int32_t;
+#endif
+
namespace zim
{
typedef uint32_t size_type;
Index: src/search.cpp
===================================================================
- --- src/search.cpp (revision 236)
+++ src/search.cpp (working copy)
@@ -106,7 +106,7 @@
// weight position of words in the document
if (Search::getWeightPos())
for (itp = posList.begin(); itp != posList.end(); ++itp)
- - priority += Search::getWeightPos() / pow(1.01, itp->first);
+ priority += Search::getWeightPos() / pow((double)1.01,
(double)itp->first); // here is a ambiguity between to pow() functions
(pow(double, int) or pow(double, double))
if (Search::getWeightPosRel())
for (itp = posList.begin(); itp != posList.end(); ++itp)
Index: src/bunzip2stream.cpp
===================================================================
- --- src/bunzip2stream.cpp (revision 236)
+++ src/bunzip2stream.cpp (working copy)
@@ -113,7 +113,8 @@
// there is data already available
// read compressed data from source into ibuffer
log_debug("in_avail=" << sinksource->in_avail());
- - stream.avail_in = sinksource->sgetn(ibuffer(),
std::min(sinksource->in_avail(), ibuffer_size()));
+
+ stream.avail_in = sinksource->sgetn(ibuffer(),
min(sinksource->in_avail(), ibuffer_size())); // compile genereates an
error if you have the "std::", do not know exactly why.
}
else
{
Index: src/uuid.cpp
===================================================================
- --- src/uuid.cpp (revision 236)
+++ src/uuid.cpp (working copy)
@@ -20,12 +20,31 @@
#include <zim/uuid.h>
#include <iostream>
#include <time.h>
- -#include <sys/time.h>
+#include <zim/zim.h> // necessary to have the new types
#include "log.h"
#ifdef WITH_CXXTOOLS
#include <cxxtools/md5stream.h>
#endif
+#if defined(_MSC_VER) || defined(__MINGW32__)
+# include <time.h>
+# include <Windows.h>
+#else
+# include <sys/time.h>
+#endif
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+int gettimeofday(struct timeval* tp, void* tzp) {
+ DWORD t;
+ t = timeGetTime();
+ tp->tv_sec = t / 1000;
+ tp->tv_usec = t % 1000;
+ /* 0 indicates that the call succeeded. */
+ return 0;
+}
+#endif // time related function/headers are differents und win32
+
+
log_define("zim.uuid")
namespace zim
@@ -62,7 +81,12 @@
*reinterpret_cast<int32_t*>(ret.data) =
reinterpret_cast<int32_t>(&ret);
*reinterpret_cast<int32_t*>(ret.data + 4) =
static_cast<int32_t>(tv.tv_sec);
*reinterpret_cast<int32_t*>(ret.data + 8) =
static_cast<int32_t>(tv.tv_usec);
+
+ #if defined(_MSC_VER)
+ *reinterpret_cast<int32_t*>(ret.data + 12) =
static_cast<int32_t>(GetCurrentProcessId());
+ #else
*reinterpret_cast<int32_t*>(ret.data + 12) =
static_cast<int32_t>(getpid()); // getpid() is GetCurrentProcessId()
under win32
+ #endif
#endif
Index: src/qunicode.cpp
===================================================================
- --- src/qunicode.cpp (revision 236)
+++ src/qunicode.cpp (working copy)
@@ -18,6 +18,7 @@
*/
#include <zim/qunicode.h>
+#include <zim/zim.h> // for the types compatibilty
#include "log.h"
#include <iostream>
#include <sstream>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpwmusACgkQn3IpJRpNWtN4YQCfaYy9rGS5nrWyYqb5Nk8bs6eo
hgsAoKTPFo/75jY1GhUZM+iWGbGDP2dg
=goMa
-----END PGP SIGNATURE-----
>
> Unfortunately, the issue seems to be worth now:
> ..\src\bunzip2stream.cpp(47) : error C2226: Syntaxfehler: Typ 'T' nicht
> erwartet ..\src\bunzip2stream.cpp(47) : error C2988: Unerkannte
> Vorlagendeklaration/-definition ..\src\bunzip2stream.cpp(47) : error C2059:
> Syntaxfehler: '<cv-qualifer>' ..\src\bunzip2stream.cpp(47) : error C2059:
> Syntaxfehler: ')'
> ..\src\bunzip2stream.cpp(49) : error C2143: Syntaxfehler: Es fehlt ';' vor
> '}' ..\src\bunzip2stream.cpp(85) : error C2065: 'ret': nichtdeklarierter
> Bezeichner ..\src\bunzip2stream.cpp(86) : error C2065: 'ret':
> nichtdeklarierter Bezeichner ..\src\bunzip2stream.cpp(94) : error C2065:
> 'ret': nichtdeklarierter Bezeichner ..\src\bunzip2stream.cpp(122) : error
> C2589: '(': Ungültiges Token auf der rechten Seite von '::'
> ..\src\bunzip2stream.cpp(122) : error C2988: Unerkannte
> Vorlagendeklaration/-definition ..\src\bunzip2stream.cpp(122) : error
> C2059: Syntaxfehler: '::'
>
> Emmanuel
Strange. I tried to solve the issue by defining my own min template function.
The problem is, that min is defined as a macro somewhere in windows.h I think.
This can be prevented by #define NOMINMAX. But I wonder, where windows.h is
included. Maybe in bzlib.h.
I renamed my min-function now.
Tommi
Hi Tommi,
Thank you to have integrated the diff and clean it a little bite.
It works now almost, and only almost because you do not modify the bunzip2stream.cc like indicated in the diff.
I give you now the whol log of the compilation, you will see expect the error on bunzip2strea.cc there are alos a few warnings, maybe you will have ideas to avoid them.
------ Neues Erstellen gestartet: Projekt: zimlib, Konfiguration: Debug Win32 ------
Die Zwischen- und Ausgabedateien für das Projekt "zimlib" mit der Konfiguration "Debug|Win32" werden gelöscht.
Kompilieren...
article.cpp
zintstream.cpp
..\src\zintstream.cpp(40) : warning C4554: '<<': Prüfen Sie Operatorrangfolge auf mögliche Fehler; verwenden Sie runde Klammern, um den Vorrang zu verdeutlichen
uuid.cpp
unicode.cpp
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(33) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(39) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(45) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(51) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(57) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(63) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(68) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(74) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(86) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/unicode.h(92) : warning C4800: 'int': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
template.cpp
search.cpp
qunicode.cpp
ptrstream.cpp
inflatestream.cpp
..\src\inflatestream.cpp(123) : warning C4996: 'std::basic_streambuf<_Elem,_Traits>::sgetn': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Programme\Microsoft Visual Studio 9.0\VC\include\streambuf(121): Siehe Deklaration von 'std::basic_streambuf<_Elem,_Traits>::sgetn'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
..\src\inflatestream.cpp(128) : warning C4996: 'std::basic_streambuf<_Elem,_Traits>::sgetn': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Programme\Microsoft Visual Studio 9.0\VC\include\streambuf(121): Siehe Deklaration von 'std::basic_streambuf<_Elem,_Traits>::sgetn'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
indexarticle.cpp
..\src\indexarticle.cpp(72) : warning C4800: 'void *': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(70) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\indexarticle.cpp(130): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "T fromLittleEndian<zim::size_type>(const T *,bool)".
with
[
T=zim::size_type
]
fileimpl.cpp
..\src\fileimpl.cpp(65) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Programme\Microsoft Visual Studio 9.0\VC\include\string.h(126): Siehe Deklaration von 'strerror'
..\src\fileimpl.cpp(82) : warning C4244: 'Argument': Konvertierung von 'zim::offset_type' in 'std::streamoff', möglicher Datenverlust
..\src\fileimpl.cpp(97) : warning C4244: 'Argument': Konvertierung von 'zim::offset_type' in 'std::streamoff', möglicher Datenverlust
..\src\fileimpl.cpp(132) : warning C4244: 'Argument': Konvertierung von 'unsigned __int64' in 'std::streamoff', möglicher Datenverlust
..\src\fileimpl.cpp(169) : warning C4244: 'Argument': Konvertierung von 'unsigned __int64' in 'std::streamoff', möglicher Datenverlust
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(70) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\fileimpl.cpp(90): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "T fromLittleEndian<unsigned __int64>(const T *,bool)".
with
[
T=unsigned __int64
]
fileheader.cpp
..\src\fileheader.cpp(38) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\xutility(2576): Siehe Deklaration von 'std::copy'
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(51) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\fileheader.cpp(36): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void toLittleEndian<zim::size_type>(const T &,char *,bool)".
with
[
T=zim::size_type
]
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(58) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\xutility(2576): Siehe Deklaration von 'std::copy'
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(51) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\fileheader.cpp(40): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void toLittleEndian<zim::offset_type>(const T &,char *,bool)".
with
[
T=zim::offset_type
]
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(58) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\xutility(2576): Siehe Deklaration von 'std::copy'
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(70) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\fileheader.cpp(63): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "T fromLittleEndian<zim::size_type>(const T *,bool)".
with
[
T=zim::size_type
]
file.cpp
dirent.cpp
..\src\dirent.cpp(91) : warning C4800: 'char': Variable wird auf booleschen Wert ('True' oder 'False') gesetzt (Auswirkungen auf Leistungsverhalten möglich)
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(51) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\dirent.cpp(50): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void toLittleEndian<zim::size_type>(const T &,char *,bool)".
with
[
T=zim::size_type
]
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(58) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\xutility(2576): Siehe Deklaration von 'std::copy'
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(51) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\dirent.cpp(51): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void toLittleEndian<uint16_t>(const T &,char *,bool)".
with
[
T=uint16_t
]
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(58) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\xutility(2576): Siehe Deklaration von 'std::copy'
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(70) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\dirent.cpp(98): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "T fromLittleEndian<zim::size_type>(const T *,bool)".
with
[
T=zim::size_type
]
deflatestream.cpp
cluster.cpp
c:\code\moulinkiwix\dependences\win\zimlib\include\zim/endian.h(70) : warning C4996: 'std::reverse_copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
C:\Programme\Microsoft Visual Studio 9.0\VC\include\algorithm(1632): Siehe Deklaration von 'std::reverse_copy'
..\src\cluster.cpp(61): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "T fromLittleEndian<zim::size_type>(const T *,bool)".
with
[
T=zim::size_type
]
bzip2stream.cpp
bzip2.cpp
bunzip2stream.cpp
..\src\bunzip2stream.cpp(117) : error C2589: '(': Ungültiges Token auf der rechten Seite von '::'
..\src\bunzip2stream.cpp(117) : error C2059: Syntaxfehler: '::'
articlesearch.cpp
Code wird generiert...
Das Buildprotokoll wurde unter "file://c:\code\moulinkiwix\dependences\win\zimlib\zimlib\Debug\BuildLog.htm" gespeichert.
zimlib - 2 Fehler, 34 Warnung(en)
========== Alles neu erstellen: 0 erfolgreich, Fehler bei 1, 0 übersprungen ==========
Besten Dank
Emmanuel
Le ven 31/07/09 22:36, "Tommi Mäkitalo" tommi(a)tntnet.org a écrit:
> Hi again,
>
> I was impatient and applied the patch and after some cleanup I checked it
> in.
Can you please test, if the version in svn still compile on windows?
>
> Tommi
>
> On Freitag, 31. Juli 2009 21:54:03 Tommi Mäkitalo wrote:
> > Hi Emmanuel,
> >
> > great to hear. I'm sure it will work if it
> compile.
>
> > Can you please send me the patch as attachement. The
> lines are wrapped so
> the patch can't be applied easily.
> >
> > Tommi
> >
> > On Mittwoch, 29. Juli 2009 20:54:41 Emmanuel
> Engelhart wrote:
> > Hi,
> > >
> > > I have achieved to compile a first version of a
> zimlib.lib (static
> > library under Windows). I do not really know if
> I can use it... but at
> > least it compiles.
> > >
> > > I want to give you here the modifications I
> have done to achieve that.
> > Tommi, it would be great to include them (or
> others with the same
> > purpose) into the SVN.
> > >
> > > Index: include/zim/zim.h
> > >
> ===================================================================
> > > --- include/zim/zim.h (revision
> 236)
> > +++ include/zim/zim.h (working
> copy)
> > @@ -22,6 +22,12 @@
> > >
> > > #include <stdint.h>
> > >
> > > +#ifdef _WIN32
> > > +typedef unsigned __int64 uint64_t;
> > > +typedef signed __int8 int8_t;
> > > +typedef signed __int32 int32_t;
> > > +#endif
> > > +
> > > namespace zim
> > > {
> > > typedef uint32_t size_type;
> > > Index: src/search.cpp
> > >
> ===================================================================
> > > --- src/search.cpp (revision 236)
> > > +++ src/search.cpp (working copy)
> > > @@ -106,7 +106,7 @@
> > > // weight position of words in the
> document
> > if (Search::getWeightPos())
> > > for (itp = posList.begin(); itp !=
> posList.end(); ++itp)
> > - priority += Search::getWeightPos() /
> pow(1.01, itp->first);
> > + priority += Search::getWeightPos() /
> pow((double)1.01,
> > (double)itp->first); // here is a ambiguity
> between to pow() functions
> > (pow(double, int) or pow(double,
> double))
> >
> > > if
> (Search::getWeightPosRel())
> > for (itp = posList.begin(); itp !=
> posList.end(); ++itp)
> > Index: src/bunzip2stream.cpp
> > >
> ===================================================================
> > > --- src/bunzip2stream.cpp (revision
> 236)
> > +++ src/bunzip2stream.cpp (working
> copy)
> > @@ -113,7 +113,8 @@
> > > // there is data already
> available
> > // read compressed data from source
> into ibuffer
> > log_debug("in_avail=" <<
> sinksource->in_avail());
> > - stream.avail_in =
> sinksource->sgetn(ibuffer(),
> > std::min(sinksource->in_avail(),
> ibuffer_size()));
> > +
> > > + stream.avail_in =
> sinksource->sgetn(ibuffer(),
> > min(sinksource->in_avail(),
> ibuffer_size())); // compile genereates an
> > error if you have the "std::", do not know
> exactly why.
> > }
> > > else
> > > {
> > > Index: src/uuid.cpp
> > >
> ===================================================================
> > > --- src/uuid.cpp (revision 236)
> > > +++ src/uuid.cpp (working copy)
> > > @@ -20,12 +20,31 @@
> > > #include <zim/uuid.h>
> > > #include <iostream>
> > > #include <time.h>
> > > -#include <sys/time.h>
> > > +#include <zim/zim.h> // necessary to
> have the new types
> > #include "log.h"
> > > #ifdef WITH_CXXTOOLS
> > > #include
> <cxxtools/md5stream.h>
> > #endif
> > >
> > > +#if defined(_MSC_VER) ||
> defined(__MINGW32__)
> > +# include <time.h>
> > > +# include <Windows.h>
> > > +#else
> > > +# include <sys/time.h>
> > > +#endif
> > > +
> > > +#if defined(_MSC_VER) ||
> defined(__MINGW32__)
> > +int gettimeofday(struct timeval* tp, void*
> tzp) {
> > + DWORD t;
> > > + t = timeGetTime();
> > > + tp->tv_sec = t / 1000;
> > > + tp->tv_usec = t % 1000;
> > > + /* 0 indicates that the call succeeded.
> */
> > + return 0;
> > > +}
> > > +#endif // time related function/headers are
> differents und win32
> > +
> > > +
> > > log_define("zim.uuid")
> > >
> > > namespace zim
> > > @@ -62,7 +81,12 @@
> > >
> *reinterpret_cast<int32_t*>(ret.data) =
> >
> reinterpret_cast<int32_t>(&ret);
> > *reinterpret_cast<int32_t*>(ret.data
> + 4) =
> >
> static_cast<int32_t>(tv.tv_sec);
> > *reinterpret_cast<int32_t*>(ret.data
> + 8) =
> >
> static_cast<int32_t>(tv.tv_usec);
> > +
> > > + #if defined(_MSC_VER)
> > > + *reinterpret_cast<int32_t*>(ret.data +
> 12) =
> >
> static_cast<int32_t>(GetCurrentProcessId());
> > + #else
> > > *reinterpret_cast<int32_t*>(ret.data
> + 12) =
> > static_cast<int32_t>(getpid()); //
> getpid() is GetCurrentProcessId()
> > under win32
> > > + #endif
> > >
> > > #endif
> > >
> > > Index: src/qunicode.cpp
> > >
> ===================================================================
> > > --- src/qunicode.cpp (revision 236)
> > > +++ src/qunicode.cpp (working copy)
> > > @@ -18,6 +18,7 @@
> > > */
> > >
> > > #include <zim/qunicode.h>
> > > +#include <zim/zim.h> // for the types
> compatibilty
> > #include "log.h"
> > > #include <iostream>
> > > #include <sstream>
> > >
> _______________________________________________
> > dev-l mailing list
> > > dev-l@openz
> im.org
> > https://intern.openzim.org/mailman/listinfo/dev-l
> >>
> >
> _______________________________________________
> dev-l mailing list
> > dev-l@openz
> im.org
> https://intern.openzim.org/mailman/listinfo/dev-l
> >
> _______________________________________________
> dev-l mailing list
> dev-l@openz
> im.orghttps://intern.openzim.org/mailman/listinfo/dev-l
>
>