bug 715586: checksums.py should generate sha1 and md5 checksums. r=catlee,ted
[gecko.git] / config / gcc-stl-wrapper.template.h
blobd51d2a74d93c025a80ab0ca8e5dce6601754d5ef
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
4 /* ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at:
10 * http://www.mozilla.org/MPL/
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 * for the specific language governing rights and limitations under the
15 * License.
17 * The Original Code is Mozilla Code.
19 * The Initial Developer of the Original Code is
20 * The Mozilla Foundation
21 * Portions created by the Initial Developer are Copyright (C) 2010
22 * the Initial Developer. All Rights Reserved.
24 * Contributor(s):
25 * Chris Jones <jones.chris.g@gmail.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either the GNU General Public License Version 2 or later (the "GPL"), or
29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
41 #ifndef mozilla_${HEADER}_h
42 #define mozilla_${HEADER}_h
44 // For some reason, Apple's GCC refuses to honor -fno-exceptions when
45 // compiling ObjC.
46 #if __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
47 # error "STL code can only be used with -fno-exceptions"
48 #endif
50 // Silence "warning: #include_next is a GCC extension"
51 #pragma GCC system_header
53 // mozalloc.h wants <new>; break the cycle by always explicitly
54 // including <new> here. NB: this is a tad sneaky. Sez the gcc docs:
56 // `#include_next' does not distinguish between <file> and "file"
57 // inclusion, nor does it check that the file you specify has the
58 // same name as the current file. It simply looks for the file
59 // named, starting with the directory in the search path after the
60 // one where the current file was found.
61 #include_next <new>
63 // See if we're in code that can use mozalloc. NB: this duplicates
64 // code in nscore.h because nscore.h pulls in prtypes.h, and chromium
65 // can't build with that being included before base/basictypes.h.
66 #if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
67 # include "mozilla/mozalloc.h"
68 #else
69 # error "STL code can only be used with infallible ::operator new()"
70 #endif
72 #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
73 // Enable checked iterators and other goodies
75 // FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
76 // Figure out how to resolve this with -fno-rtti. Maybe build with
77 // -frtti in DEBUG builds?
79 // # define _GLIBCXX_DEBUG 1
80 #endif
82 #pragma GCC visibility push(default)
83 #include_next <${HEADER}>
84 #pragma GCC visibility pop
86 // gcc calls a __throw_*() function from bits/functexcept.h when it
87 // wants to "throw an exception". functexcept exists nominally to
88 // support -fno-exceptions, but since we'll always use the system
89 // libstdc++, and it's compiled with exceptions, then in practice
90 // these __throw_*() functions will always throw exceptions (shades of
91 // -fshort-wchar). We don't want that and so define our own inlined
92 // __throw_*().
93 #ifndef mozilla_throw_gcc_h
94 # include "mozilla/throw_gcc.h"
95 #endif
97 #endif // if mozilla_${HEADER}_h