Skip to content

Commit b6c62ef

Browse files
committed
[lldb/Platform] Re-add ifdef's to guard macOS-only code.
I moved the code from the system initializer to PlatformMacOSX. The defines are still necessary because MacOSX is initialized on other platforms where the other platforms are not available.
1 parent 2a879e6 commit b6c62ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "PlatformMacOSX.h"
10+
#if defined(__APPLE__)
1011
#include "PlatformAppleTVSimulator.h"
1112
#include "PlatformAppleWatchSimulator.h"
1213
#include "PlatformDarwinKernel.h"
1314
#include "PlatformRemoteAppleBridge.h"
1415
#include "PlatformRemoteAppleTV.h"
1516
#include "PlatformRemoteAppleWatch.h"
1617
#include "PlatformiOSSimulator.h"
18+
#endif
1719
#include "lldb/Breakpoint/BreakpointLocation.h"
1820
#include "lldb/Core/Module.h"
1921
#include "lldb/Core/ModuleList.h"
@@ -40,13 +42,15 @@ static uint32_t g_initialize_count = 0;
4042

4143
void PlatformMacOSX::Initialize() {
4244
PlatformDarwin::Initialize();
45+
#if defined(__APPLE__)
4346
PlatformiOSSimulator::Initialize();
4447
PlatformDarwinKernel::Initialize();
4548
PlatformAppleTVSimulator::Initialize();
4649
PlatformAppleWatchSimulator::Initialize();
4750
PlatformRemoteAppleTV::Initialize();
4851
PlatformRemoteAppleWatch::Initialize();
4952
PlatformRemoteAppleBridge::Initialize();
53+
#endif
5054

5155
if (g_initialize_count++ == 0) {
5256
#if defined(__APPLE__)
@@ -67,13 +71,15 @@ void PlatformMacOSX::Terminate() {
6771
}
6872
}
6973

74+
#if defined(__APPLE__)
7075
PlatformRemoteAppleBridge::Terminate();
7176
PlatformRemoteAppleWatch::Terminate();
7277
PlatformRemoteAppleTV::Terminate();
7378
PlatformAppleWatchSimulator::Terminate();
7479
PlatformAppleTVSimulator::Terminate();
7580
PlatformDarwinKernel::Terminate();
7681
PlatformiOSSimulator::Terminate();
82+
#endif
7783
PlatformDarwin::Terminate();
7884
}
7985

0 commit comments

Comments
 (0)