mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Macros to control inlining are not used and we explicitly recommending against playing with compiler inlining. The macros for alignment became part of the standard in C++11 and we already use the standard variants over these macros (see `PointerData`). The formatters are unused as well and we use the stream based variants for formatting.
30 lines
967 B
C
30 lines
967 B
C
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_FML_COMPILER_SPECIFIC_H_
|
|
#define FLUTTER_FML_COMPILER_SPECIFIC_H_
|
|
|
|
#if !defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)
|
|
#error Unsupported compiler.
|
|
#endif
|
|
|
|
// Annotate a variable indicating it's ok if the variable is not used.
|
|
// (Typically used to silence a compiler warning when the assignment
|
|
// is important for some other reason.)
|
|
// Use like:
|
|
// int x = ...;
|
|
// FML_ALLOW_UNUSED_LOCAL(x);
|
|
#define FML_ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
|
|
|
|
// Annotate a typedef or function indicating it's ok if it's not used.
|
|
// Use like:
|
|
// typedef Foo Bar ALLOW_UNUSED_TYPE;
|
|
#if defined(__GNUC__) || defined(__clang__)
|
|
#define FML_ALLOW_UNUSED_TYPE __attribute__((unused))
|
|
#else
|
|
#define FML_ALLOW_UNUSED_TYPE
|
|
#endif
|
|
|
|
#endif // FLUTTER_FML_COMPILER_SPECIFIC_H_
|