Kaydet (Commit) e79b387e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

It is very wrong to #undef _DEBUG in some source files of a library

Nowadays in a dbgutil build with MSVC, the debugging runtime (C++
library) is used. Just like with the GNU libstdc++, it is not binary
compatible with the non-debugging variant.

All sources that go into one DLL or EXE must be compiled with the same
_DEBUG settings (unless one is extremely careful and knows exactly
what one is doing, which presumably is not the case with this code).

With previous compilers this has gone undetected, but with MSVC2012 at
least, you get link-time errors, which is a good thing:

nssinitializer.o : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in biginteger.o

nssinitializer.o : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in biginteger.o

Whether this actually has caused run-time erroneous behaviour or
not in a dbgutil build is another thing...

Change-Id: I0c42161f00a0e37b438e3b911e3c0058edadd800
üst b80d8c69
......@@ -18,13 +18,6 @@
*/
/*
* Turn off DEBUG Assertions
*/
#ifdef _DEBUG
#undef _DEBUG
#endif
/*
* and turn off the additional virtual methods which are part of some interfaces when compiled
* with debug
......
......@@ -17,14 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/*
* Turn off DEBUG Assertions
*/
#ifdef _DEBUG
#undef _DEBUG
#endif
/*
* and turn off the additional virtual methods which are part of some interfaces when compiled
* with debug
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment