blob: bddebe1135f221055ca2a67a22a07e6a44273b58 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#pragma once
#include <util/system/compiler.h>
#if defined(__GNUC__)
#define ATTRIBUTE(args...) __attribute__((args))
#else
#define ATTRIBUTE(...)
#endif
#if defined(__GNUC__) && !defined(__clang__)
#define COLD_BLOCK_BYVALUE [=]() ATTRIBUTE(noinline, cold) {
#define COLD_BLOCK_BYREF [&]() ATTRIBUTE(noinline, cold) {
#define COLD_BLOCK_END \
} \
();
#else
// Clang does not support gnu-style attributes on lambda functions yet
#define COLD_BLOCK_BYVALUE [=]() {
#define COLD_BLOCK_BYREF [&]() {
#define COLD_BLOCK_END \
} \
();
#endif
|