aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/detail/macros.h
blob: 8d9707c351bb653f74e69a2469bc103a62674a0d (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