There's a mismatch #endif in win32.h. I restore a #if from previous version to detect MSVC and MinGW64, otherwise it will build failed with MinGW, because MinGW does not support *_s() functions.
tdm-gcc-4.7.1-2 from http://tdm-gcc.tdragon.net/download.
As I remember the official MinGW(not MinGW-w64) distribution also does not support *_s() functions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What MinGW distribution are you using? What version of it?
tdm-gcc-4.7.1-2 from http://tdm-gcc.tdragon.net/download.
As I remember the official MinGW(not MinGW-w64) distribution also does not support *_s() functions.
Some of them do support those functions for sure. I have tested that. I will try that one to see if I can work around it somehow automagically.
One more thing. How exactly are you building log4cplus? What build system etc. are you using? See http://log4cplus.sourceforge.net/#bug-reporting-instructions
Sorry, my build env:
win7 sp1 x64
cmake 2.8.10.2
tdm-gcc 4.7.1-2
log4cplus 1.1.1 rc2
cmake out-of-source builds configuration:
md build
cd build
cmake .. -G "MinGW Makefiles" ^
-DBUILD_SHARED_LIBS:BOOL=OFF ^
-DLOG4CPLUS_BUILD_TESTING:BOOL=OFF ^
-DUNICODE:BOOL=OFF ^
-DCMAKE_BUILD_TYPE:STRING=Release
mingw32-make
build failed with:
win32.h:188:2: error: #endif without #if
simply remove that #endif, it still build failed with:
lockfile.cxx:176:5: error: 'errno_t' was not declared in this scope
Please replace the win32.h file with the attached one. It fixes the issue and some more.
It works! Great job & thanks.
I have pushed the fixes to Bazaar repository. Closing.