~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to mozilla/config/msvc-stl-wrapper.template.h

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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/. */
 
7
 
 
8
#ifndef mozilla_${HEADER}_h
 
9
#define mozilla_${HEADER}_h
 
10
 
 
11
#if _HAS_EXCEPTIONS
 
12
#  error "STL code can only be used with -fno-exceptions"
 
13
#endif
 
14
 
 
15
// Code built with !_HAS_EXCEPTIONS calls std::_Throw(), but the win2k
 
16
// CRT doesn't export std::_Throw().  So we define it.
 
17
#ifndef mozilla_Throw_h
 
18
#  include "mozilla/throw_msvc.h"
 
19
#endif
 
20
 
 
21
// Code might include <new> before other wrapped headers, but <new>
 
22
// includes <exception> and so we want to wrap it.  But mozalloc.h
 
23
// wants <new> also, so we break the cycle by always explicitly
 
24
// including <new> here.
 
25
#include <${NEW_HEADER_PATH}>
 
26
 
 
27
// See if we're in code that can use mozalloc.  NB: this duplicates
 
28
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
 
29
// can't build with that being included before base/basictypes.h.
 
30
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
 
31
#  include "mozilla/mozalloc.h"
 
32
#else
 
33
#  error "STL code can only be used with infallible ::operator new()"
 
34
#endif
 
35
 
 
36
#ifdef DEBUG
 
37
// From
 
38
//   http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx
 
39
// and
 
40
//   http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx
 
41
// there appear to be two types of STL container checking.  The
 
42
// former is enabled by -D_DEBUG (which is implied by -DDEBUG), and
 
43
// looks to be full generation/mutation checked iterators as done by
 
44
// _GLIBCXX_DEBUG.  The latter appears to just be bounds checking, and
 
45
// is enabled by the following macros.  It appears that the _DEBUG
 
46
// iterators subsume _SECURE_SCL, and the following settings are
 
47
// default anyway, so we'll just leave this commented out.
 
48
//#  define _SECURE_SCL 1
 
49
//#  define _SECURE_SCL_THROWS 0
 
50
#else
 
51
// Note: _SECURE_SCL iterators are on by default in opt builds.  We
 
52
// could leave them on, but since gcc doesn't, we might as well
 
53
// preserve that behavior for perf reasons.  nsTArray is in the same
 
54
// camp as gcc.  Can revisit later.
 
55
//
 
56
// FIXME/bug 551254: because we're not wrapping all the STL headers we
 
57
// use, undefining this here can cause some headers to be built with
 
58
// iterator checking and others not.  Turning this off until we have a
 
59
// better plan.
 
60
//#  undef _SECURE_SCL
 
61
#endif
 
62
 
 
63
// We know that code won't be able to catch exceptions, but that's OK
 
64
// because we're not throwing them.
 
65
#pragma warning( push )
 
66
#pragma warning( disable : 4530 )
 
67
 
 
68
#include <${HEADER_PATH}>
 
69
 
 
70
#pragma warning( pop )
 
71
 
 
72
#endif  // if mozilla_${HEADER}_h