libebml: fix the Debug class use

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@796 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Steve Lhomme 2011-09-09 04:00:42 +00:00
parent 5eea000814
commit 2490c80ad1
6 changed files with 16 additions and 16 deletions

View File

@ -52,7 +52,7 @@ START_LIBEBML_NAMESPACE
static const int MAX_PREFIX_LENGTH = 128;
#if defined(DEBUG)
#if defined(LIBEBML_DEBUG)
// define the working debugging class
class EBML_DLL_API ADbg
@ -102,7 +102,7 @@ private:
#endif // WIN32
};
#else // defined(DEBUG)
#else // defined(LIBEBML_DEBUG)
// define a class that does nothing (no output)
@ -145,7 +145,7 @@ public:
}
};
#endif // defined(DEBUG)
#endif // defined(LIBEBML_DEBUG)
extern class EBML_DLL_API ADbg globalDebug;

View File

@ -96,7 +96,7 @@
// The LIBEBML_DEBUG symbol is defined, when we are creating a debug build. In this
// case the debug logging code is compiled in.
#if (defined(DEBUG)||defined(_DEBUG))&&!defined(LIBEBML_DEBUG)
#if (defined(DEBUG)||defined(_DEBUG)) && !defined(LIBEBML_DEBUG)
#define LIBEBML_DEBUG
#endif

View File

@ -14,7 +14,7 @@ LIB ebml
REDUCE_SIZE .
FASTER_FLOAT .
// SOURCE src/Debug.cpp
SOURCE src/Debug.cpp
SOURCE src/EbmlBinary.cpp
SOURCE src/EbmlContexts.cpp
SOURCE src/EbmlCrc32.cpp
@ -38,7 +38,7 @@ LIB ebml
SOURCE(TARGET_WIN) src/platform/win32/WinIOCallback.cpp
HEADER(TARGET_WIN) src/platform/win32/WinIOCallback.h
// HEADER ebml/Debug.h
HEADER ebml/Debug.h
HEADER ebml/EbmlBinary.h
HEADER ebml/EbmlConfig.h
HEADER ebml/EbmlContexts.h

View File

@ -49,7 +49,7 @@ START_LIBEBML_NAMESPACE
class ADbg globalDebug;
#if defined(DEBUG)
#if defined(LIBEBML_DEBUG)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@ -232,6 +232,6 @@ bool ADbg::unsetDebugFile() {
return result;
}
#endif // defined(DEBUG)
#endif // defined(LIBEBML_DEBUG)
END_LIBEBML_NAMESPACE

View File

@ -582,14 +582,14 @@ filepos_t EbmlElement::Render(IOCallback & output, bool bWithDefault, bool bKeep
if (!bWithDefault && IsDefaultValue()) {
return 0;
}
#if defined(_DEBUG) || defined(DEBUG)
#if defined(LIBEBML_DEBUG)
uint64 SupposedSize = UpdateSize(bWithDefault, bForceRender);
#endif // _DEBUG
#endif // LIBEBML_DEBUG
filepos_t result = RenderHead(output, bForceRender, bWithDefault, bKeepPosition);
uint64 WrittenSize = RenderData(output, bForceRender, bWithDefault);
#if defined(_DEBUG) || defined(DEBUG)
#if defined(LIBEBML_DEBUG)
if (static_cast<int64>(SupposedSize) != (0-1)) assert(WrittenSize == SupposedSize);
#endif // DEBUG
#endif // LIBEBML_DEBUG
result += WrittenSize;
return result;
} catch (std::exception & ex) {

View File

@ -145,10 +145,10 @@ uint64 EbmlMaster::UpdateSize(bool bWithDefault, bool bForceRender)
continue;
(ElementList[Index])->UpdateSize(bWithDefault, bForceRender);
uint64 SizeToAdd = (ElementList[Index])->ElementSize(bWithDefault);
#if defined(_DEBUG) || defined(DEBUG)
#if defined(LIBEBML_DEBUG)
if (static_cast<int64>(SizeToAdd) == (0-1))
return (0-1);
#endif // DEBUG
#endif // LIBEBML_DEBUG
SetSize_(GetSize() + SizeToAdd);
}
if (bChecksumUsed) {
@ -204,10 +204,10 @@ bool EbmlMaster::CheckMandatory() const
for (EltIdx = 0; EltIdx < EBML_CTX_SIZE(Context); EltIdx++) {
if (EBML_CTX_IDX(Context,EltIdx).IsMandatory()) {
if (FindElt(EBML_CTX_IDX_INFO(Context,EltIdx)) == NULL) {
#if defined(_DEBUG) || defined(DEBUG)
#if defined(LIBEBML_DEBUG)
// you are missing this Mandatory element
// const char * MissingName = EBML_INFO_NAME(EBML_CTX_IDX_INFO(Context,EltIdx));
#endif // DEBUG
#endif // LIBEBML_DEBUG
return false;
}
}