diff options
author | Xanadu <none@none> | 2010-07-20 02:49:28 +0200 |
---|---|---|
committer | Xanadu <none@none> | 2010-07-20 02:49:28 +0200 |
commit | 79622802f397258ee0f34327ba3ae6977ca3e7ff (patch) | |
tree | 1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/checked_iterator.h | |
parent | 7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff) | |
parent | f906976837502fa5aa81b982b901d1509f5aa0c4 (diff) |
Merge. Revision history for source files should be all back now.
--HG--
branch : trunk
rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt
rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp
rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h
rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp
rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/checked_iterator.h')
-rw-r--r-- | externals/ace/checked_iterator.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/externals/ace/checked_iterator.h b/externals/ace/checked_iterator.h new file mode 100644 index 00000000000..08940e62bbb --- /dev/null +++ b/externals/ace/checked_iterator.h @@ -0,0 +1,58 @@ +// -*- C++ -*- + +#ifndef ACE_CHECKED_ITERATOR_H +#define ACE_CHECKED_ITERATOR_H + +/** + * @file checked_iterator.h + * + * @brief Checked iterator factory function. + * + * Some compilers (e.g. MSVC++ >= 8) issue security related + * diagnostics if algorithms such as std::copy() are used in an unsafe + * way. Normally this isn't an issue if STL container iterators are + * used in conjuction with the standard algorithms. However, in cases + * where application-specific iterators are use with standard + * algorithms that could potentially overrun a buffer, extra care must + * be taken to prevent such an overrun. If supported, checked + * iterators can be used to address the potential destination buffer + * overrun. + * + * This header provides function templates that generate the + * appropriate checked iterator. In cases where checked iterators are + * not supported, the pointer passed to the function is returned + * instead. + * + * $Id: checked_iterator.h 88263 2009-12-20 07:58:09Z johnnyw $ + * + * @internal The functions and types in this header are meant for + * internal use. They may change at any point between + * releases. + * + * @author Ossama Othman + */ + +# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) && (!defined (_STLPORT_VERSION)) +// Checked iterators are currently only supported in MSVC++ 8 or better. +# include <iterator> +# endif /* _MSC_VER >= 1400 && !_STLPORT_VERSION */ + +# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) && (!defined (_STLPORT_VERSION)) +template <typename PTR> +stdext::checked_array_iterator<PTR> +ACE_make_checked_array_iterator (PTR buf, size_t len) +{ + return stdext::checked_array_iterator<PTR> (buf, len); +} +# else +template <typename PTR> +PTR +ACE_make_checked_array_iterator (PTR buf, size_t /* len */) +{ + // Checked iterators are unsupported. Just return the pointer to + // the buffer itself. + return buf; +} +# endif /* _MSC_VER >= 1400 && !_STLPORT_VERSION */ + +#endif /* ACE_CHECKED_ITERATOR_H */ |