~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to build/stdc++compat.cpp

  • Committer: Chris Coulson
  • Date: 2011-08-05 17:37:02 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110805173702-n11ykbt0tdp5u07q
Refresh build system from FIREFOX_6_0b5_BUILD1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License. You may obtain a copy of the License at
 
7
 * http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * The Original Code is a hack to avoid dependencies on recent libstdc++.
 
15
 *
 
16
 * The Initial Developer of the Original Code is
 
17
 * Mozilla Foundation.
 
18
 * Portions created by the Initial Developer are Copyright (C) 2011
 
19
 * the Initial Developer. All Rights Reserved.
 
20
 *
 
21
 * Contributor(s):
 
22
 *   Mike Hommey <mh@glandium.org>
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the MPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the MPL, the GPL or the LGPL.
 
35
 *
 
36
 * ***** END LICENSE BLOCK ***** */
 
37
 
 
38
#include <ostream>
 
39
#include <istream>
 
40
#ifdef DEBUG
 
41
#include <string>
 
42
#endif
 
43
 
 
44
namespace std {
 
45
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)
 
46
    /* Instantiate these templates to avoid GLIBCXX_3.4.9 symbol versions */
 
47
    template ostream& ostream::_M_insert(double);
 
48
    template ostream& ostream::_M_insert(long);
 
49
    template ostream& ostream::_M_insert(unsigned long);
 
50
    template ostream& __ostream_insert(ostream&, const char*, streamsize);
 
51
    template istream& istream::_M_extract(double&);
 
52
#endif
 
53
#ifdef DEBUG
 
54
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)
 
55
    /* Instantiate these templates to avoid GLIBCXX_3.4.14 symbol versions
 
56
     * in debug builds */
 
57
    template char *string::_S_construct_aux_2(size_type, char, allocator<char> const&);
 
58
#ifdef _GLIBCXX_USE_WCHAR_T
 
59
    template wchar_t *wstring::_S_construct_aux_2(size_type, wchar_t, allocator<wchar_t> const&);
 
60
#endif /* _GLIBCXX_USE_WCHAR_T */
 
61
#ifdef __GXX_EXPERIMENTAL_CXX0X__
 
62
    template string::basic_string(string&&);
 
63
    template string& string::operator=(string&&);
 
64
    template wstring::basic_string(wstring&&);
 
65
    template wstring& wstring::operator=(wstring&&);
 
66
    template wstring& wstring::assign(wstring&&);
 
67
#endif /* __GXX_EXPERIMENTAL_CXX0X__ */
 
68
#endif /* (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5) */
 
69
#endif /* DEBUG */
 
70
}
 
71
 
 
72
namespace std __attribute__((visibility("default"))) {
 
73
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)
 
74
    /* Hack to avoid GLIBCXX_3.4.14 symbol versions */
 
75
    struct _List_node_base
 
76
    {
 
77
        void hook(_List_node_base * const __position) throw ();
 
78
 
 
79
        void unhook() throw ();
 
80
 
 
81
        void transfer(_List_node_base * const __first,
 
82
                      _List_node_base * const __last) throw();
 
83
 
 
84
/* Hack to avoid GLIBCXX_3.4.15 symbol versions */
 
85
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)
 
86
        static void swap(_List_node_base& __x, _List_node_base& __y) throw ();
 
87
    };
 
88
 
 
89
    namespace __detail {
 
90
 
 
91
    struct _List_node_base
 
92
    {
 
93
#endif
 
94
        void _M_hook(_List_node_base * const __position) throw ();
 
95
 
 
96
        void _M_unhook() throw ();
 
97
 
 
98
        void _M_transfer(_List_node_base * const __first,
 
99
                         _List_node_base * const __last) throw();
 
100
 
 
101
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)
 
102
        static void swap(_List_node_base& __x, _List_node_base& __y) throw ();
 
103
#endif
 
104
    };
 
105
 
 
106
    /* The functions actually have the same implementation */
 
107
    void
 
108
    _List_node_base::_M_hook(_List_node_base * const __position) throw ()
 
109
    {
 
110
        ((std::_List_node_base *)this)->hook((std::_List_node_base * const) __position);
 
111
    }
 
112
 
 
113
    void
 
114
    _List_node_base::_M_unhook() throw ()
 
115
    {
 
116
        ((std::_List_node_base *)this)->unhook();
 
117
    }
 
118
 
 
119
    void
 
120
    _List_node_base::_M_transfer(_List_node_base * const __first,
 
121
                                 _List_node_base * const __last) throw ()
 
122
    {
 
123
        ((std::_List_node_base *)this)->transfer((std::_List_node_base * const)__first,
 
124
                                                 (std::_List_node_base * const)__last);
 
125
    }
 
126
 
 
127
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)
 
128
    void
 
129
    _List_node_base::swap(_List_node_base& __x, _List_node_base& __y) throw ()
 
130
    {
 
131
        std::_List_node_base::swap(*((std::_List_node_base *) &__x),
 
132
                                   *((std::_List_node_base *) &__y));
 
133
    }
 
134
}
 
135
#endif
 
136
 
 
137
#endif /* (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5) */
 
138
 
 
139
#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)
 
140
    /* Hack to avoid GLIBCXX_3.4.11 symbol versions
 
141
       An inline definition of ctype<char>::_M_widen_init() used to be in
 
142
       locale_facets.h before GCC 4.4, but moved out of headers in more
 
143
       recent versions.
 
144
       It is actually safe to make it do nothing. */
 
145
    void ctype<char>::_M_widen_init() const {}
 
146
#endif
 
147
 
 
148
}