Lines 12-44
Link Here
|
12 |
// compiling ObjC. |
12 |
// compiling ObjC. |
13 |
#if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) |
13 |
#if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) |
14 |
# error "STL code can only be used with -fno-exceptions" |
14 |
# error "STL code can only be used with -fno-exceptions" |
15 |
#endif |
15 |
#endif |
16 |
|
16 |
|
17 |
// Silence "warning: #include_next is a GCC extension" |
17 |
// Silence "warning: #include_next is a GCC extension" |
18 |
#pragma GCC system_header |
18 |
#pragma GCC system_header |
19 |
|
19 |
|
|
|
20 |
// Don't include mozalloc for cstdlib. See bug 1245076. |
21 |
#ifndef moz_dont_include_mozalloc_for_cstdlib |
22 |
# define moz_dont_include_mozalloc_for_cstdlib |
23 |
#endif |
24 |
#ifndef moz_dont_include_mozalloc_for_${HEADER} |
20 |
// mozalloc.h wants <new>; break the cycle by always explicitly |
25 |
// mozalloc.h wants <new>; break the cycle by always explicitly |
21 |
// including <new> here. NB: this is a tad sneaky. Sez the gcc docs: |
26 |
// including <new> here. NB: this is a tad sneaky. Sez the gcc docs: |
22 |
// |
27 |
// |
23 |
// `#include_next' does not distinguish between <file> and "file" |
28 |
// `#include_next' does not distinguish between <file> and "file" |
24 |
// inclusion, nor does it check that the file you specify has the |
29 |
// inclusion, nor does it check that the file you specify has the |
25 |
// same name as the current file. It simply looks for the file |
30 |
// same name as the current file. It simply looks for the file |
26 |
// named, starting with the directory in the search path after the |
31 |
// named, starting with the directory in the search path after the |
27 |
// one where the current file was found. |
32 |
// one where the current file was found. |
28 |
#include_next <new> |
33 |
# include_next <new> |
29 |
|
34 |
|
30 |
// See if we're in code that can use mozalloc. NB: this duplicates |
35 |
// See if we're in code that can use mozalloc. NB: this duplicates |
31 |
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium |
36 |
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium |
32 |
// can't build with that being included before base/basictypes.h. |
37 |
// can't build with that being included before base/basictypes.h. |
33 |
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) |
38 |
# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) |
34 |
# include "mozilla/mozalloc.h" |
39 |
# include "mozilla/mozalloc.h" |
35 |
#else |
40 |
# else |
36 |
# error "STL code can only be used with infallible ::operator new()" |
41 |
# error "STL code can only be used with infallible ::operator new()" |
|
|
42 |
# endif |
43 |
|
37 |
#endif |
44 |
#endif |
38 |
|
45 |
|
39 |
#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG) |
46 |
#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG) |
40 |
// Enable checked iterators and other goodies |
47 |
// Enable checked iterators and other goodies |
41 |
// |
48 |
// |
42 |
// FIXME/bug 551254: gcc's debug STL implementation requires -frtti. |
49 |
// FIXME/bug 551254: gcc's debug STL implementation requires -frtti. |
43 |
// Figure out how to resolve this with -fno-rtti. Maybe build with |
50 |
// Figure out how to resolve this with -fno-rtti. Maybe build with |
44 |
// -frtti in DEBUG builds? |
51 |
// -frtti in DEBUG builds? |