23#if defined (_STLP_DEBUG)
24#if defined (_STLP_THREADS)
25# if !defined (_STLP_NEED_MUTABLE)
26# define _STLP_ACQUIRE_LOCK(_Lock) _Lock._M_acquire_lock();
27# define _STLP_RELEASE_LOCK(_Lock) _Lock._M_release_lock();
29# define _STLP_ACQUIRE_LOCK(_Lock) ((_STLP_mutex&)_Lock)._M_acquire_lock();
30# define _STLP_RELEASE_LOCK(_Lock) ((_STLP_mutex&)_Lock)._M_release_lock();
33# define _STLP_ACQUIRE_LOCK(_Lock)
34# define _STLP_RELEASE_LOCK(_Lock)
45template <
class _Iterator>
47stlp_in_range_aux(
const _Iterator&
__it,
const _Iterator& __first,
49 return (
__it >= __first &&
54template <
class _Iterator1,
class _Iterator>
55#if defined (_STLP_MSVC)
56inline bool _STLP_CALL stlp_in_range_aux(_Iterator1
__it,
const _Iterator& __first,
58inline bool _STLP_CALL stlp_in_range_aux(
const _Iterator1&
__it,
const _Iterator& __first,
61 _Iterator1 __i(__first);
66#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
67template <
class _Iterator1,
class _Iterator>
69stlp_in_range_aux(
const _Iterator1&
__it,
const _Iterator& __first,
71 _Iterator1 __i(__first);
77template <
class _Iterator>
78bool _STLP_CALL __check_range_aux(
const _Iterator& __first,
const _Iterator&
__last,
80 _STLP_VERBOSE_RETURN(__valid_range(__first,
__last), _StlMsg_INVALID_RANGE )
84template <
class _Integral>
85bool _STLP_CALL __check_range_aux(_Integral , _Integral ,
89template <
class _Iterator>
90bool _STLP_CALL __check_range(
const _Iterator& __first,
const _Iterator&
__last) {
92 return __check_range_aux(__first,
__last, _Integral());
95template <
class _Iterator>
97 const _Iterator& __start,
const _Iterator& __finish) {
98 _STLP_VERBOSE_RETURN(stlp_in_range(
__it, __start, __finish),
99 _StlMsg_NOT_IN_RANGE_1)
103template <
class _Iterator>
104bool _STLP_CALL __check_range(
const _Iterator& __first,
const _Iterator&
__last,
105 const _Iterator& __start,
const _Iterator& __finish) {
106 _STLP_VERBOSE_RETURN(stlp_in_range(__first,
__last, __start, __finish),
107 _StlMsg_NOT_IN_RANGE_2)
113 _STLP_VERBOSE_RETURN((__first != 0 ||
__last == 0), _StlMsg_INVALID_ARGUMENT)
115 _StlMsg_INVALID_RANGE)
120template <
class _Iterator>
121void _STLP_CALL __invalidate_range(
const __owned_list* __base,
122 const _Iterator& __first,
123 const _Iterator&
__last) {
124 typedef __owned_link _L_type;
125 _STLP_ACQUIRE_LOCK(__base->_M_lock)
126 _L_type* __prev =
__CONST_CAST(_L_type*, &__base->_M_node);
127 _L_type* __pos = __prev->_M_next;
131 stlp_in_range_aux(
__STATIC_CAST(_Iterator*, __pos)->_M_iterator,
132 __first._M_iterator,
__last._M_iterator,
135 __prev->_M_next = __pos->_M_next;
140 __pos = __prev->_M_next;
142 _STLP_RELEASE_LOCK(__base->_M_lock)
145template <
class _Iterator>
146void _STLP_CALL __invalidate_iterator(
const __owned_list* __base,
147 const _Iterator&
__it) {
148 typedef __owned_link _L_type;
149 _STLP_ACQUIRE_LOCK(__base->_M_lock)
150 _L_type* __prev =
__CONST_CAST(_L_type*, &__base->_M_node);
151 _L_type* __pos = __prev->_M_next;
157 __prev->_M_next = __pos->_M_next;
162 __pos = __prev->_M_next;
164 _STLP_RELEASE_LOCK(__base->_M_lock)
167template <
class _Iterator>
168void _STLP_CALL __change_range_owner(
const _Iterator& __first,
170 const __owned_list* __dst) {
171 if (__first._Owner() == __dst)
174 typedef __owned_link _L_type;
177 __owned_list *__base =
__CONST_CAST(__owned_list*, __first._Owner());
178 _L_type* __src_prev = &__base->_M_node;
179 _L_type* __pos = __src_prev->_M_next;
180 _L_type* __dst_prev =
__CONST_CAST(_L_type*, &__dst->_M_node);
184 stlp_in_range_aux(
__STATIC_CAST(_Iterator*, __pos)->_M_iterator,
185 __first._M_iterator,
__last._M_iterator,
189 __src_prev->_M_next = __pos->_M_next;
191 __pos->_M_next = __dst_prev->_M_next;
192 __dst_prev->_M_next = __pos;
197 __pos = __src_prev->_M_next;
200#if defined(_STLP_WCE) && defined(_ARM_)
213template <
class _Iterator>
215 const __owned_list* __dst) {
216 if (
__it._Owner() == __dst)
219 typedef __owned_link _L_type;
223 _L_type* __prev = &__base->_M_node;
224 _L_type* __pos = __prev->_M_next;
225 _L_type* __dst_prev =
__CONST_CAST(_L_type*, &__dst->_M_node);
233 __prev->_M_next = __pos->_M_next;
235 __pos->_M_next = __dst_prev->_M_next;
236 __dst_prev->_M_next = __pos;
241 __pos = __prev->_M_next;
251#if defined (_STLP_EXPOSE_GLOBALS_IMPLEMENTATION)
253# ifndef _STLP_INTERNAL_CSTDLIB
262# if defined (_STLP_ASSERTIONS)
267# if !defined (_STLP_STRING_LITERAL)
268# define _STLP_STRING_LITERAL(__x) __x
271# if defined (_STLP_USE_WIDE_INTERFACE)
273# define _STLP_PERCENT_S "%hs"
275# define _STLP_PERCENT_S "%s"
278# define _STLP_MESSAGE_TABLE_BODY = { \
279_STLP_STRING_LITERAL("\n" _STLP_PERCENT_S "(%d): STL error: " _STLP_PERCENT_S "\n"), \
280_STLP_STRING_LITERAL(_STLP_PERCENT_S "(%d): STL assertion failure : " _STLP_PERCENT_S "\n" _STLP_ASSERT_MSG_TRAILER), \
281_STLP_STRING_LITERAL("\n" _STLP_PERCENT_S "(%d): STL error : " _STLP_PERCENT_S "\n" _STLP_PERCENT_S "(%d): STL assertion failure: " _STLP_PERCENT_S " \n" _STLP_ASSERT_MSG_TRAILER), \
282_STLP_STRING_LITERAL("Invalid argument to operation (see operation documentation)"), \
283_STLP_STRING_LITERAL("Taking an iterator out of destroyed (or otherwise corrupted) container"), \
284_STLP_STRING_LITERAL("Trying to extract an object out from empty container"),\
285_STLP_STRING_LITERAL("Past-the-end iterator could not be erased"), \
286_STLP_STRING_LITERAL("Index out of bounds"), \
287_STLP_STRING_LITERAL("Container doesn't own the iterator"), \
288_STLP_STRING_LITERAL("Container is owner of the iterator, but should not"), \
289_STLP_STRING_LITERAL("Uninitialized or invalidated (by mutating operation) iterator used"), \
290_STLP_STRING_LITERAL("Uninitialized or invalidated (by mutating operation) lefthand iterator in expression"), \
291_STLP_STRING_LITERAL("Uninitialized or invalidated (by mutating operation) righthand iterator in expression"), \
292_STLP_STRING_LITERAL("Iterators used in expression are from different owners"), \
293_STLP_STRING_LITERAL("Iterator could not be dereferenced (past-the-end ?)"), \
294_STLP_STRING_LITERAL("Range [first,last) is invalid"), \
295_STLP_STRING_LITERAL("Iterator is not in range [first,last)"), \
296_STLP_STRING_LITERAL("Range [first,last) is not in range [start,finish)"), \
297_STLP_STRING_LITERAL("The advance would produce invalid iterator"), \
298_STLP_STRING_LITERAL("Iterator is singular (advanced beyond the bounds ?)"), \
299_STLP_STRING_LITERAL("Invalid strict weak ordering predicate, if pred(a, b) then we should have !pred(b, a)"), \
300_STLP_STRING_LITERAL("Invalid equivalent predicate, if pred(a, b) then we should have pred(b, a)"), \
301_STLP_STRING_LITERAL("Memory block deallocated twice"), \
302_STLP_STRING_LITERAL("Deallocating a block that was never allocated"), \
303_STLP_STRING_LITERAL("Deallocating a memory block allocated for another type"), \
304_STLP_STRING_LITERAL("Size of block passed to deallocate() doesn't match block size"), \
305_STLP_STRING_LITERAL("Pointer underrun - safety margin at front of memory block overwritten"), \
306_STLP_STRING_LITERAL("Pointer overrrun - safety margin at back of memory block overwritten"), \
307_STLP_STRING_LITERAL("Attempt to dereference null pointer returned by auto_ptr::get()"), \
308_STLP_STRING_LITERAL("Memory allocation function returned a wrongly align memory block"), \
309_STLP_STRING_LITERAL("Unknown problem") \
312template <
class _Dummy>
313const char* __stl_debug_engine<_Dummy>::_Message_table[_StlMsg_MAX] _STLP_MESSAGE_TABLE_BODY;
315# undef _STLP_STRING_LITERAL
316# undef _STLP_PERCENT_S
321# if !defined (_STLP_DEBUG_MESSAGE)
322# ifndef _STLP_INTERNAL_CSTDARG
325# ifndef _STLP_INTERNAL_CSTDIO
328# if defined (_STLP_DEBUG_MODE_THROWS) && !defined (_STLP_RANGE_ERRORS_H)
335template <
class _Dummy>
337__stl_debug_engine<_Dummy>::_Message(
const char * __format_str, ...) {
338 STLPORT_CSTD::va_list __args;
341# if !defined (_STLP_DEBUG_MODE_THROWS)
342# if defined (_STLP_USE_WIDE_INTERFACE)
344 int _convert =
strlen(__format_str) + 1;
350# elif defined (_STLP_WIN32) && (defined(_STLP_MSVC) || defined (__ICL))
351 char __buffer [4096];
353# if !defined (_STLP_USE_SAFE_STRING_FUNCTIONS)
361# elif defined (__amigaos__)
362 STLPORT_CSTD::vfprintf(
stderr, __format_str, (
char *)__args);
364 STLPORT_CSTD::vfprintf(
stderr, __format_str, __args);
369# if defined (_STLP_USE_SAFE_STRING_FUNCTIONS)
371# elif defined (_STLP_WIN32) && (defined(_STLP_MSVC) || defined (__ICL))
374 vsprintf(__buffer, __format_str, __args);
378# ifdef _STLP_DEBUG_MESSAGE_POST
384# if defined (_STLP_DEBUG_MODE_THROWS)
395template <
class _Dummy>
397__stl_debug_engine<_Dummy>::_Message(
const char * __format_str, ...)
406template <
class _Dummy>
408__stl_debug_engine<_Dummy>::_IndexedError(
int __error_ind,
const char* __f,
int __l) {
409 __stl_debug_message(_Message_table[_StlFormat_ERROR_RETURN],
410 __f, __l, _Message_table[__error_ind]);
413template <
class _Dummy>
415__stl_debug_engine<_Dummy>::_VerboseAssert(
const char* __expr,
int __error_ind,
const char* __f,
int __l) {
416 __stl_debug_message(_Message_table[_StlFormat_VERBOSE_ASSERTION_FAILURE],
417 __f, __l, _Message_table[__error_ind], __f, __l, __expr);
418 __stl_debug_terminate();
421template <
class _Dummy>
423__stl_debug_engine<_Dummy>::_Assert(
const char* __expr,
const char* __f,
int __l) {
424 __stl_debug_message(_Message_table[_StlFormat_ASSERTION_FAILURE],__f, __l, __expr);
425 __stl_debug_terminate();
430template <
class _Dummy>
432__stl_debug_engine<_Dummy>::_Terminate()
440# if defined (_STLP_DEBUG)
449template <
class _Dummy>
451__stl_debug_engine<_Dummy>::_Invalidate_all(__owned_list* __l) {
452 _STLP_ACQUIRE_LOCK(__l->_M_lock);
454 __l->_M_node._M_next =0;
455 _STLP_RELEASE_LOCK(__l->_M_lock);
459template <
class _Dummy>
461__stl_debug_engine<_Dummy>::_Stamp_all(__owned_list* __l, __owned_list* __o) {
463 if (__l->_M_node._M_owner) {
464 for (__owned_link* __pos = (__owned_link*)__l->_M_node._M_next;
465 __pos != 0; __pos = (__owned_link*)__pos->_M_next) {
472template <
class _Dummy>
474__stl_debug_engine<_Dummy>::_Verify(
const __owned_list* __l) {
475 _STLP_ACQUIRE_LOCK(__l->_M_lock);
478 for (__owned_link* __pos = (__owned_link*)__l->_M_node._M_next;
479 __pos != 0; __pos = (__owned_link*)__pos->_M_next) {
483 _STLP_RELEASE_LOCK(__l->_M_lock);
486template <
class _Dummy>
488__stl_debug_engine<_Dummy>::_Swap_owners(__owned_list& __x, __owned_list& __y) {
502 __tmp = __x._M_node._M_next;
504 _Stamp_all(&__x, &__y);
505 _Stamp_all(&__y, &__x);
507 __x._M_node._M_next = __y._M_node._M_next;
508 __y._M_node._M_next = __tmp;
511template <
class _Dummy>
513__stl_debug_engine<_Dummy>::_Set_owner(__owned_list& __src, __owned_list& __dst) {
514 if (&__src == &__dst)
518 typedef __owned_link _L_type;
519 _L_type* __prev = &__src._M_node;
520 _L_type* __pos = __prev->_M_next;
523 __pos->_M_owner = &__dst;
525 __pos = __prev->_M_next;
527 __prev->_M_next = __dst._M_node._M_next;
528 __dst._M_node._M_next = __src._M_node._M_next;
529 __src._M_node._M_next = 0;
532template <
class _Dummy>
534__stl_debug_engine<_Dummy>::_M_detach(__owned_list* __l, __owned_link* __c_node) {
539 _STLP_ACQUIRE_LOCK(__l->_M_lock)
541 if(__c_node->_M_owner != 0) {
542 __owned_link* __prev, *__next;
544 for (__prev = &__l->_M_node; (__next = __prev->_M_next) != __c_node;
549 __prev->_M_next = __c_node->_M_next;
550 __c_node->_M_owner=0;
552 _STLP_RELEASE_LOCK(__l->_M_lock)
556template <
class _Dummy>
558__stl_debug_engine<_Dummy>::_M_attach(__owned_list* __l, __owned_link* __c_node) {
560 (__c_node)->_M_owner = 0;
563 _STLP_ACQUIRE_LOCK(__l->_M_lock)
564 __c_node->_M_owner = __l;
565 __c_node->_M_next = __l->_M_node._M_next;
566 __l->_M_node._M_next = __c_node;
567 _STLP_RELEASE_LOCK(__l->_M_lock)
573__stl_debug_engine<_Dummy>::_Get_container_ptr(
const __owned_link* __l) {
574 const __owned_list* __owner = __l->_Owner();
575 _STLP_VERBOSE_RETURN_0(__owner != 0, _StlMsg_INVALID_ITERATOR)
577 _STLP_VERBOSE_RETURN_0(__ret !=0, _StlMsg_INVALID_CONTAINER)
581template <
class _Dummy>
583__stl_debug_engine<_Dummy>::_Check_same_owner(
const __owned_link& __i1,
584 const __owned_link& __i2) {
585 _STLP_VERBOSE_RETURN(__i1._Valid(), _StlMsg_INVALID_LEFTHAND_ITERATOR)
586 _STLP_VERBOSE_RETURN(__i2._Valid(), _StlMsg_INVALID_RIGHTHAND_ITERATOR)
587 _STLP_VERBOSE_RETURN((__i1._Owner() == __i2._Owner()), _StlMsg_DIFFERENT_OWNERS)
591template <
class _Dummy>
593__stl_debug_engine<_Dummy>::_Check_same_or_null_owner(
const __owned_link& __i1,
594 const __owned_link& __i2) {
595 _STLP_VERBOSE_RETURN(__i1._Owner() == __i2._Owner(), _StlMsg_DIFFERENT_OWNERS)
599template <
class _Dummy>
601__stl_debug_engine<_Dummy>::_Check_if_owner(
const __owned_list * __l,
const __owned_link&
__it) {
602 const __owned_list* __owner_ptr =
__it._Owner();
603 _STLP_VERBOSE_RETURN(__owner_ptr != 0, _StlMsg_INVALID_ITERATOR)
604 _STLP_VERBOSE_RETURN(__l == __owner_ptr, _StlMsg_NOT_OWNER)
608template <
class _Dummy>
610__stl_debug_engine<_Dummy>::_Check_if_not_owner(
const __owned_list * __l,
const __owned_link&
__it) {
611 const __owned_list* __owner_ptr =
__it._Owner();
612 _STLP_VERBOSE_RETURN(__owner_ptr != 0, _StlMsg_INVALID_ITERATOR)
613 _STLP_VERBOSE_RETURN(__l != __owner_ptr, _StlMsg_SHOULD_NOT_OWNER)
#define random_access_iterator_tag
_STLP_INLINE_LOOP _InputIter __last
#define _STLP_DEBUG_MESSAGE_POST
#define _STLP_ASSERT(expr)
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
#define _STLP_WINCE_TRACE(msg)
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_MOVE_TO_PRIV_NAMESPACE const _InputIterator const input_iterator_tag &_InputIterator __it(__first)
_STLP_BEGIN_NAMESPACE _STLP_THROW_FUNCT_SPEC _STLP_CALL __stl_throw_runtime_error(const char *__msg)
ACPI_SIZE strlen(const char *String)
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define MultiByteToWideChar
#define _STLP_MOVE_TO_STD_NAMESPACE
#define __STATIC_CAST(__x, __y)
#define __CONST_CAST(__x, __y)
#define _STLP_BEGIN_NAMESPACE
#define _STLP_ARRAY_SIZE(A)
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)