-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvironment_variables_util.h
56 lines (47 loc) · 1.93 KB
/
environment_variables_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_UTIL_H_
#define OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_UTIL_H_
#include "environment_variables.h"
#include "environment_variables_parser.h"
#include "string.h"
#include "util.h"
#define CheckIfTrue(EXPR) \
static int sValue = -1; \
if (sValue == -1) { \
const auto envValue = EXPR; \
sValue = TrueCondition(envValue) ? 1 : 0; \
} \
return sValue == 1;
#define CheckIfFalse(EXPR) \
static int sValue = -1; \
if (sValue == -1) { \
const auto envValue = EXPR; \
sValue = FalseCondition(envValue) ? 1 : 0; \
} \
return sValue == 1;
#define ToBooleanWithDefault(EXPR, DEFAULT) \
static int sValue = -1; \
if (sValue == -1) { \
const auto envValue = EXPR; \
if (TrueCondition(envValue)) { \
sValue = 1; \
} else if (FalseCondition(envValue)) { \
sValue = 0; \
} else { \
sValue = DEFAULT; \
} \
} \
return sValue == 1;
namespace trace {
bool DisableOptimizations();
bool EnableInlining();
bool IsNGENEnabled();
bool IsDumpILRewriteEnabled();
bool IsAzureAppServices();
bool IsFailFastEnabled();
bool IsNetFxAssemblyRedirectionEnabled();
} // namespace trace
#endif // OTEL_CLR_PROFILER_ENVIRONMENT_VARIABLES_UTIL_H_