Skip to content

Commit 2128207

Browse files
committed
NetFX-Stack-Capture guard windoes specific code behind win32 macro
1 parent 68b8c4c commit 2128207

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/OpenTelemetry.AutoInstrumentation.Native/netfx_stack_capture_strategy_x64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef OTEL_PROFILER_NETFX_STACK_CAPTURE_STRATEGY_H_
55
#define OTEL_PROFILER_NETFX_STACK_CAPTURE_STRATEGY_H_
66

7-
#ifdef _M_AMD64
7+
#if defined(_WIN32) && defined(_M_AMD64)
88

99
#include "stack_capture_strategy.h"
1010
#include "profiler_stack_capture.h"
@@ -61,5 +61,5 @@ class NetFxStackCaptureStrategyX64 : public IStackCaptureStrategy {
6161

6262
} // namespace continuous_profiler
6363

64-
#endif // _M_AMD64
64+
#endif // defined(_WIN32) && defined(_M_AMD64)
6565
#endif // OTEL_PROFILER_NETFX_STACK_CAPTURE_STRATEGY_H_

src/OpenTelemetry.AutoInstrumentation.Native/profiler_stack_capture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
#ifdef _M_AMD64
4+
#if defined(_WIN32) && defined(_M_AMD64)
55
#include "profiler_stack_capture.h"
66

77
#include <stdexcept>
@@ -666,4 +666,4 @@ HRESULT StackCaptureEngine::CaptureStacks(std::unordered_set<ThreadID> const&
666666
}
667667

668668
} // namespace ProfilerStackCapture
669-
#endif
669+
#endif // defined(_WIN32) && defined(_M_AMD64)

src/OpenTelemetry.AutoInstrumentation.Native/profiler_stack_capture.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef OTEL_PROFILER_STACK_CAPTURE_H_
44
#define OTEL_PROFILER_STACK_CAPTURE_H_
55

6-
#ifdef _M_AMD64
6+
#if defined(_WIN32) && defined(_M_AMD64)
77

88
#include <windows.h>
99
#include <vector>
@@ -166,5 +166,5 @@ namespace ProfilerStackCapture {
166166

167167
} // namespace ProfilerStackCapture
168168

169-
#endif // _M_AMD64
169+
#endif // defined(_WIN32) && defined(_M_AMD64)
170170
#endif // OTEL_PROFILER_STACK_CAPTURE_H_

src/OpenTelemetry.AutoInstrumentation.Native/stack_capture_strategy_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "stack_capture_strategy_factory.h"
55
#include "dot_net_stack_capture_strategy.h"
6-
#ifdef _M_AMD64
6+
#if defined(_WIN32) && defined(_M_AMD64)
77
#include "netfx_stack_capture_strategy_x64.h"
88
#endif
99

@@ -16,7 +16,7 @@ std::unique_ptr<IStackCaptureStrategy> StackCaptureStrategyFactory::Create(ICorP
1616

1717
if (runtimeInfo.is_desktop())
1818
{
19-
#ifdef _M_AMD64
19+
#if defined(_WIN32) && defined(_M_AMD64)
2020
trace::Logger::Info("StackCaptureStrategyFactory: Creating NetFxStackCaptureStrategyX64");
2121
return std::make_unique<NetFxStackCaptureStrategyX64>(profilerInfo);
2222
#else

0 commit comments

Comments
 (0)