Browse Source

MeshTools: fix the fix for CORRADE_NO_ASSERT build.

pull/122/merge
Vladimír Vondruš 11 years ago
parent
commit
540e36b2e3
  1. 4
      src/Magnum/MeshTools/Interleave.h

4
src/Magnum/MeshTools/Interleave.h

@ -166,12 +166,12 @@ parameters.
contain the interleaved data.
*/
template<class T, class ...U> void interleaveInto(Containers::ArrayView<char> buffer, const T& first, const U&... next) {
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
/* Verify expected buffer size */
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...);
#endif
const std::size_t stride = Implementation::Stride{}(first, next...);
CORRADE_ASSERT(attributeCount*stride <= buffer.size(), "MeshTools::interleaveInto(): the data buffer is too small, expected" << attributeCount*stride << "but got" << buffer.size(), );
#endif
/* Write data */
Implementation::writeInterleaved(stride, buffer.begin(), first, next...);

Loading…
Cancel
Save