author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sun, 30 Nov 2014 10:06:35 +0100 | |
branch | firefox31 |
changeset 812 | bb30bb6a8754 |
parent 754 | b294bc0cb51e |
permissions | -rw-r--r-- |
754
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1 |
# HG changeset patch |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
2 |
# Parent c7f2d830f66744f9da21b93f80017d28b5fba9a0 |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
3 |
# User Wolfgang Rosenauer <wr@rosenauer.org> |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
4 |
Bug 1044581 - compilation error: bit_reader.cc:12:3: error: 'nullptr' was not declared in this scope |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
5 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
6 |
diff --git a/content/media/fmp4/demuxer/bit_reader.cc b/content/media/fmp4/demuxer/bit_reader.cc |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
7 |
--- a/content/media/fmp4/demuxer/bit_reader.cc |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
8 |
+++ b/content/media/fmp4/demuxer/bit_reader.cc |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
9 |
@@ -1,12 +1,13 @@ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
10 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
11 |
// Use of this source code is governed by a BSD-style license that can be |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
12 |
// found in the LICENSE file. |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
13 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
14 |
+#include "nullptr.h" |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
15 |
#include "mp4_demuxer/bit_reader.h" |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
16 |
#include <algorithm> |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
17 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
18 |
namespace mp4_demuxer { |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
19 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
20 |
BitReader::BitReader(const uint8_t* data, off_t size) |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
21 |
: data_(data), bytes_left_(size), num_remaining_bits_in_curr_byte_(0) { |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
22 |
DCHECK(data_ != nullptr && bytes_left_ > 0); |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
23 |
diff --git a/content/media/fmp4/moz.build b/content/media/fmp4/moz.build |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
24 |
--- a/content/media/fmp4/moz.build |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
25 |
+++ b/content/media/fmp4/moz.build |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
26 |
@@ -2,16 +2,17 @@ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
27 |
# vim: set filetype=python: |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
28 |
# This Source Code Form is subject to the terms of the Mozilla Public |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
29 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
30 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
31 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
32 |
EXPORTS += [ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
33 |
'MP4Decoder.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
34 |
'MP4Reader.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
35 |
+ 'nullptr.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
36 |
'PlatformDecoderModule.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
37 |
] |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
38 |
|
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
39 |
EXPORTS.mp4_demuxer += [ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
40 |
'demuxer/aac.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
41 |
'demuxer/audio_decoder_config.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
42 |
'demuxer/avc.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
43 |
'demuxer/basictypes.h', |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
44 |
diff --git a/content/media/fmp4/nullptr.h b/content/media/fmp4/nullptr.h |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
45 |
new file mode 100644 |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
46 |
--- /dev/null |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
47 |
+++ b/content/media/fmp4/nullptr.h |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
48 |
@@ -0,0 +1,7 @@ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
49 |
+ |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
50 |
+// GCC does not understand nullptr until 4.6 |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
51 |
+#if defined(__GNUC__) && !defined(__clang__) |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
52 |
+#if __GNUC__ * 100 + __GNUC_MINOR__ < 406 |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
53 |
+#define nullptr __null |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
54 |
+#endif |
b294bc0cb51e
fix nullptr usage with gcc 4.5
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
55 |
+#endif |