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