Skip to content

Commit

Permalink
Merge pull request #226 from namrog84/master
Browse files Browse the repository at this point in the history
Add VS2022 support and misc
  • Loading branch information
wonday authored Jul 30, 2022
2 parents 63354d6 + 03aad40 commit fb9ecf9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
12 changes: 11 additions & 1 deletion windows/OrientationWindows/OrientationWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ namespace OrientationWindows {
}
}

void OrientationLockerModule::addListener(std::string) noexcept
{
// Keep: Required for RN built in Event Emitter Calls.
}

void OrientationLockerModule::removeListeners(int64_t) noexcept
{
// Keep: Required for RN built in Event Emitter Calls.
}

void OrientationLockerModule::GetOrientation(std::function<void(std::string)> cb) noexcept {
m_context.UIDispatcher().Post([weakThis = weak_from_this(), this, cb]() {
if (auto strongThis = weakThis.lock())
Expand Down Expand Up @@ -211,4 +221,4 @@ namespace OrientationWindows {
std::string OrientationLockerModule::GetInitOrientation() noexcept {
return m_initialOrientation;
}
}
}
8 changes: 8 additions & 0 deletions windows/OrientationWindows/OrientationWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ namespace OrientationWindows {
REACT_INIT(Initialize)
void Initialize(React::ReactContext const& reactContext) noexcept;

// Only used to suppress some warnings. Not actually used at this time.
REACT_METHOD(addListener);
void addListener(std::string) noexcept;

// Only used to suppress some warnings. Not actually used at this time.
REACT_METHOD(removeListeners);
void removeListeners(int64_t) noexcept;

REACT_METHOD(GetOrientation, L"getOrientation");
void GetOrientation(std::function<void(std::string)> cb) noexcept;

Expand Down
6 changes: 1 addition & 5 deletions windows/OrientationWindows/OrientationWindows.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
Expand Down Expand Up @@ -155,11 +156,6 @@
<ItemGroup>
<Midl Include="ReactPackageProvider.idl" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(ReactNativeWindowsDir)\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj">
<Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<!--Here-->
<ImportGroup Label="ReactNativeWindowsTargets">
Expand Down

0 comments on commit fb9ecf9

Please sign in to comment.