Bug 1698786: part 1) Add some logging to `mozInlineSpellChecker`. r=masayuki
[gecko.git] / config / gcc-stl-wrapper.template.h
blob0003722b2c8bb9f01001c704f73cb731dfd036c1
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef mozilla_${HEADER}_h
9 #define mozilla_${HEADER}_h
11 // For some reason, Apple's GCC refuses to honor -fno-exceptions when
12 // compiling ObjC.
13 #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
14 # error "STL code can only be used with -fno-exceptions"
15 #endif
17 // Silence "warning: #include_next is a GCC extension"
18 #pragma GCC system_header
20 #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
21 // Enable checked iterators and other goodies
23 // FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
24 // Figure out how to resolve this with -fno-rtti. Maybe build with
25 // -frtti in DEBUG builds?
27 // # define _GLIBCXX_DEBUG 1
28 #endif
30 // Don't include mozalloc.h for cstdlib, type_traits, limits and iosfwd.
31 // See bug 1245076 (cstdlib), bug 1594027 (type_traits, limits) and
32 // bug 1694575 (iosfwd).
33 // Please be careful when adding more exceptions, especially regarding
34 // the header not directly or indirectly including <new>.
35 #ifndef moz_dont_include_mozalloc_for_cstdlib
36 # define moz_dont_include_mozalloc_for_cstdlib
37 #endif
39 #ifndef moz_dont_include_mozalloc_for_type_traits
40 # define moz_dont_include_mozalloc_for_type_traits
41 #endif
43 #ifndef moz_dont_include_mozalloc_for_limits
44 # define moz_dont_include_mozalloc_for_limits
45 #endif
47 #ifndef moz_dont_include_mozalloc_for_iosfwd
48 # define moz_dont_include_mozalloc_for_iosfwd
49 #endif
51 // Include mozalloc after the STL header and all other headers it includes
52 // have been preprocessed.
53 #if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
54 !defined(moz_dont_include_mozalloc_for_${HEADER})
55 # define MOZ_INCLUDE_MOZALLOC_H
56 # define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
57 #endif
59 #pragma GCC visibility push(default)
60 #include_next <${HEADER}>
61 #pragma GCC visibility pop
63 #ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
64 // See if we're in code that can use mozalloc.
65 # if !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
66 # include "mozilla/mozalloc.h"
67 # else
68 # error "STL code can only be used with infallible ::operator new()"
69 # endif
70 #endif
72 // gcc calls a __throw_*() function from bits/functexcept.h when it
73 // wants to "throw an exception". functexcept exists nominally to
74 // support -fno-exceptions, but since we'll always use the system
75 // libstdc++, and it's compiled with exceptions, then in practice
76 // these __throw_*() functions will always throw exceptions (shades of
77 // -fshort-wchar). We don't want that and so define our own inlined
78 // __throw_*().
79 #ifndef mozilla_throw_gcc_h
80 # include "mozilla/throw_gcc.h"
81 #endif
83 #endif // if mozilla_${HEADER}_h