Bug 835381 - Unit tests for the MediaSniffer to make sure Matroska files are not...
[gecko.git] / mfbt / Compiler.h
blobe4f26f42faa866ac4540730430604a27d5bb4d87
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* Various compiler checks. */
8 #ifndef mozilla_Compiler_h_
9 #define mozilla_Compiler_h_
11 #if !defined(__clang__) && defined(__GNUC__)
13 * This macro should simplify gcc version checking. For example, to check
14 * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.
16 # define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel) \
17 ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \
18 >= ((major) * 10000 + (minor) * 100 + (patchlevel)))
19 #if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)
20 # error "mfbt (and Gecko) require at least gcc 4.4 to build."
21 #endif
22 #endif
24 #endif /* mozilla_Compiler_h_ */