OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [src/] [c++98/] [compatibility-list-2.cc] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// Compatibility symbols for previous versions, list bits -*- C++ -*-
2
 
3
// Copyright (C) 2011 Free Software Foundation, Inc.
4
//
5
// This file is part of the GNU ISO C++ Library.  This library is free
6
// software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the
8
// Free Software Foundation; either version 3, or (at your option)
9
// any later version.
10
 
11
// This library is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
// GNU General Public License for more details.
15
 
16
// Under Section 7 of GPL version 3, you are granted additional
17
// permissions described in the GCC Runtime Library Exception, version
18
// 3.1, as published by the Free Software Foundation.
19
 
20
// You should have received a copy of the GNU General Public License and
21
// a copy of the GCC Runtime Library Exception along with this program;
22
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23
// <http://www.gnu.org/licenses/>.
24
 
25
#include <bits/move.h>
26
 
27
#ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT
28
# define _GLIBCXX_BEGIN_NAMESPACE_COMPAT
29
#endif
30
 
31
#ifndef _GLIBCXX_END_NAMESPACE_COMPAT
32
# define _GLIBCXX_END_NAMESPACE_COMPAT
33
#endif
34
 
35
namespace std _GLIBCXX_VISIBILITY(default)
36
{
37
_GLIBCXX_BEGIN_NAMESPACE_COMPAT
38
 
39
  struct _List_node_base
40
  {
41
    _List_node_base* _M_next;
42
    _List_node_base* _M_prev;
43
 
44
    void
45
    _M_transfer(_List_node_base * const __first,
46
                _List_node_base * const __last) _GLIBCXX_USE_NOEXCEPT;
47
 
48
    void
49
    _M_reverse() _GLIBCXX_USE_NOEXCEPT;
50
 
51
    void
52
    _M_hook(_List_node_base * const __position) _GLIBCXX_USE_NOEXCEPT;
53
 
54
    void
55
    _M_unhook() _GLIBCXX_USE_NOEXCEPT;
56
  };
57
 
58
  void
59
  _List_node_base::
60
  _M_transfer(_List_node_base * const __first,
61
              _List_node_base * const __last) _GLIBCXX_USE_NOEXCEPT
62
  {
63
    if (this != __last)
64
    {
65
      // Remove [first, last) from its old position.
66
      __last->_M_prev->_M_next  = this;
67
      __first->_M_prev->_M_next = __last;
68
      this->_M_prev->_M_next    = __first;
69
 
70
      // Splice [first, last) into its new position.
71
      _List_node_base* const __tmp = this->_M_prev;
72
      this->_M_prev                = __last->_M_prev;
73
      __last->_M_prev              = __first->_M_prev;
74
      __first->_M_prev             = __tmp;
75
    }
76
  }
77
 
78
  void
79
  _List_node_base::_M_reverse() _GLIBCXX_USE_NOEXCEPT
80
  {
81
    _List_node_base* __tmp = this;
82
    do
83
    {
84
      std::swap(__tmp->_M_next, __tmp->_M_prev);
85
 
86
      // Old next node is now prev.
87
      __tmp = __tmp->_M_prev;
88
    }
89
    while (__tmp != this);
90
  }
91
 
92
  void
93
  _List_node_base::
94
  _M_hook(_List_node_base* const __position) _GLIBCXX_USE_NOEXCEPT
95
  {
96
    this->_M_next = __position;
97
    this->_M_prev = __position->_M_prev;
98
    __position->_M_prev->_M_next = this;
99
    __position->_M_prev = this;
100
  }
101
 
102
  void
103
  _List_node_base::_M_unhook() _GLIBCXX_USE_NOEXCEPT
104
  {
105
    _List_node_base* const __next_node = this->_M_next;
106
    _List_node_base* const __prev_node = this->_M_prev;
107
    __prev_node->_M_next = __next_node;
108
    __next_node->_M_prev = __prev_node;
109
  }
110
 
111
_GLIBCXX_END_NAMESPACE_COMPAT
112
 
113
} // namespace std

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.