Am Montag, 13. Dezember 2004 06:18 schrieb Curt Arnold:
> >> I wonder why you declare apr_int64_t in log4cxx-headers. apr_int64_t
> >> is defined in apr_atomic.h, so if you need it, include this header.
> >
> > I've avoided including APR headers in the log4cxx headers to eliminate
> > the need for applications that are using log4cxx to have to add APR to
> > their include path. I'm able to use forward declarations for
> > apr_pool_t, apr_iconv_t and others. I'll review the definition for
> > apr_int64_t, but I'll resort to some other mechanism to forward
> > declare it before including APR headers in log4cxx headers.
>
> I changed apr_time_t and apr_int64_t headers to log4cxx_time_t and
> log4cxx_int64_t and made definitions that should hopefully be 64-bit or
> larger integers. In the implementation these should be assignment
> compatible with apr_time_t and apr_int64_t but should avoid the
> inconsistent declaration errors and avoids requiring apr to be in the
> include path for applications using log4cxx.
>
> Win32 is almost building. I need to fill in implementations for
> mbsnrtowcs and wcsnrtombs and am getting unexpected messages that
> StringHelper::toString(int, apr_pool_t*) is missing.
I installed apr 1.0.1. The preinstalled from apace2 was too old.
There are some declarations left. Here is what I have changed so far:
Index: src/Makefile.am
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/Makefile.am,v
retrieving revision 1.20
diff -r1.20 Makefile.am
23d22
< event.cpp \
Index: src/cacheddateformat.cpp
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/cacheddateformat.cpp,v
retrieving revision 1.5
diff -r1.5 cacheddateformat.cpp
52c52
< int CachedDateFormat::findMillisecondStart(const apr_time_t time,
---
> int CachedDateFormat::findMillisecondStart(const log4cxx_time_t time,
84c84
< void CachedDateFormat::format(LogString& s, apr_time_t date, apr_pool_t* p)
const {
---
> void CachedDateFormat::format(LogString& s, log4cxx_time_t date, apr_pool_t*
p) const {
Index: src/fileappender.cpp
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/fileappender.cpp,v
retrieving revision 1.14
diff -r1.14 fileappender.cpp
158c158
< void FileAppender::subAppend(const char* encoded, apr_size_t size,
apr_pool_t* p) {
---
> void FileAppender::subAppend(const char* encoded, log4cxx_size_t size,
apr_pool_t* p) {
Next problem is in include/log4cxx/writerapender.h:
make[1]: Entering directory `/u/src/logging-log4cxx/src'
if /bin/sh ../libtool --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I.
-I../include/log4cxx -I../include -I../include -I/usr/local/apr/include/apr-1
-I/usr/include/libxml2 -DLOG4CXX -I/usr/local/apr/include/apr-1 -D_REENTRANT
-g -O2 -MT fileappender.lo -MD -MP -MF ".deps/fileappender.Tpo" -c -o
fileappender.lo fileappender.cpp; \
then mv -f ".deps/fileappender.Tpo" ".deps/fileappender.Plo"; else rm -f
".deps/fileappender.Tpo"; exit 1;fi
g++ -DHAVE_CONFIG_H -I. -I. -I../include/log4cxx -I../include -I../include
-I/usr/local/apr/include/apr-1-I/usr/include/libxml2 -DLOG4CXX
-I/usr/local/apr/include/apr-1 -D_REENTRANT -g -O2 -MT fileappender.lo -MD
-MP -MF .deps/fileappender.Tpo -c fileappender.cpp -fPIC -DPIC
-o .libs/fileappender.o
In file included from /usr/local/apr/include/apr-1/apr_atomic.h:24,
from fileappender.cpp:23:
/usr/local/apr/include/apr-1/apr.h:259: error: conflicting types for `typedef
size_t apr_size_t'
../include/log4cxx/writerappender.h:24: error: previous declaration as
`typedef
unsigned int apr_size_t'
fileappender.cpp:158: error: type specifier omitted for parameter `
log4cxx_size_t'
fileappender.cpp:158: error: syntax error before `,' token
fileappender.cpp:158: error: prototype for `void
log4cxx::FileAppender::subAppend(...)' does not match any in class `
log4cxx::FileAppender'
../include/log4cxx/fileappender.h:172: error: candidate is: virtual void
log4cxx::FileAppender::subAppend(const char*, unsigned int, apr_pool_t*)
fileappender.cpp: In member function `void
log4cxx::FileAppender::subAppend(...)':
fileappender.cpp:160: error: `encoded' undeclared (first use this function)
fileappender.cpp:160: error: (Each undeclared identifier is reported only once
for each function it appears in.)
fileappender.cpp:160: error: `size' undeclared (first use this function)
make[1]: *** [fileappender.lo] Fehler 1
I think apr_size_t should also be log4cxx_size_t.
Tommi