Skip to content

Commit 2bdbfd3

Browse files
author
Jan Lindström
committed
Fix assertion failure seen on Buildbot win32-debug
There is a bug in Visual Studio 2010 Visual Studio has a feature "Checked Iterators". In a debug build, every iterator operation is checked at runtime for errors, e g, out of range. Disable this "Checked Iterators" for Windows and Debug if defined.
1 parent c14d9c2 commit 2bdbfd3

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

storage/innobase/sync/sync0sync.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ Created 9/5/1995 Heikki Tuuri
4747
#include "ha_prototypes.h"
4848
#include "my_cpu.h"
4949

50+
/* There is a bug in Visual Studio 2010
51+
Visual Studio has a feature "Checked Iterators". In a debug build, every
52+
iterator operation is checked at runtime for errors, e g, out of range.
53+
Disable this "Checked Iterators" for Windows and Debug if defined.
54+
*/
55+
#ifdef UNIV_DEBUG
56+
#ifdef __WIN__
57+
#ifdef _ITERATOR_DEBUG_LEVEL
58+
#define _ITERATOR_DEBUG_LEVEL 0
59+
#endif /* _ITERATOR_DEBUG_LEVEL */
60+
#endif /* __WIN__*/
61+
#endif /* UNIV_DEBUG */
62+
5063
#include <vector>
5164

5265
/*

storage/xtradb/sync/sync0sync.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ Created 9/5/1995 Heikki Tuuri
4848
#include "ha_prototypes.h"
4949
#include "my_cpu.h"
5050

51+
/* There is a bug in Visual Studio 2010
52+
Visual Studio has a feature "Checked Iterators". In a debug build, every
53+
iterator operation is checked at runtime for errors, e g, out of range.
54+
Disable this "Checked Iterators" for Windows and Debug if defined.
55+
*/
56+
#ifdef UNIV_DEBUG
57+
#ifdef __WIN__
58+
#ifdef _ITERATOR_DEBUG_LEVEL
59+
#define _ITERATOR_DEBUG_LEVEL 0
60+
#endif /* _ITERATOR_DEBUG_LEVEL */
61+
#endif /* __WIN__*/
62+
#endif /* UNIV_DEBUG */
63+
5164
#include <vector>
5265

5366
/*

0 commit comments

Comments
 (0)