blob: f585d34ded3dc4a5b0ae2296ba03027fe6e7bd3a [file] [log] [blame]
Karl Wibergee10ea82018-05-04 13:27:48 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Karl Wibergcefc4652018-05-23 23:20:38 +020011#ifndef RTC_BASE_SYSTEM_INLINE_H_
12#define RTC_BASE_SYSTEM_INLINE_H_
Karl Wibergee10ea82018-05-04 13:27:48 +020013
14#if defined(_MSC_VER)
Karl Wibergcefc4652018-05-23 23:20:38 +020015
16#define RTC_FORCE_INLINE __forceinline
Karl Wibergee10ea82018-05-04 13:27:48 +020017#define RTC_NO_INLINE __declspec(noinline)
Karl Wibergcefc4652018-05-23 23:20:38 +020018
Karl Wibergee10ea82018-05-04 13:27:48 +020019#elif defined(__GNUC__)
Karl Wibergcefc4652018-05-23 23:20:38 +020020
21#define RTC_FORCE_INLINE __attribute__((__always_inline__))
Karl Wibergee10ea82018-05-04 13:27:48 +020022#define RTC_NO_INLINE __attribute__((__noinline__))
Karl Wibergcefc4652018-05-23 23:20:38 +020023
Karl Wibergee10ea82018-05-04 13:27:48 +020024#else
Karl Wibergcefc4652018-05-23 23:20:38 +020025
26#define RTC_FORCE_INLINE
Karl Wibergee10ea82018-05-04 13:27:48 +020027#define RTC_NO_INLINE
Karl Wibergcefc4652018-05-23 23:20:38 +020028
Karl Wibergee10ea82018-05-04 13:27:48 +020029#endif
30
Karl Wibergcefc4652018-05-23 23:20:38 +020031#endif // RTC_BASE_SYSTEM_INLINE_H_