Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native implementation of resource utility #844

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/Modules/FindNF_CoreCLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ set(NF_CoreCLR_SRCS
nf_rt_native_nanoFramework_Runtime_Native_Debug.cpp
nf_rt_native_nanoFramework_Runtime_Native_ExecutionConstraint.cpp
nf_rt_native_nanoFramework_Runtime_Native_Power.cpp
nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility.cpp
nf_rt_native_nanoFramework_Runtime_Native_Rtc_stubs.cpp

# Core stubs
Expand Down
7 changes: 6 additions & 1 deletion src/CLR/Runtime.Native/nf_rt_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ static const CLR_RT_MethodHandler method_lookup[] =
NULL,
NULL,
NULL,
Library_nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility::GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum,
Library_nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility::GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum__I4__I4,
NULL,
NULL,
NULL,
Library_nf_rt_native_nanoFramework_Runtime_Native_Rtc::Native_RTC_SetSystemTime___STATIC__BOOLEAN__I4__U1__U1__U1__U1__U1__U1,
};

const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Native =
{
"nanoFramework.Runtime.Native",
0xA3593BC9,
0x1AD361FD,
method_lookup,
{ 1, 0, 0, 0 }
};
11 changes: 11 additions & 0 deletions src/CLR/Runtime.Native/nf_rt_native.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ struct Library_nf_rt_native_nanoFramework_Runtime_Native_Power

};

struct Library_nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility
{
static const int FIELD_STATIC__s_wr = 1;

NANOCLR_NATIVE_DECLARE(GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum);
NANOCLR_NATIVE_DECLARE(GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum__I4__I4);

//--//

};

struct Library_nf_rt_native_nanoFramework_Runtime_Native_Rtc
{
NANOCLR_NATIVE_DECLARE(Native_RTC_SetSystemTime___STATIC__BOOLEAN__I4__U1__U1__U1__U1__U1__U1);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright (c) 2018 The nanoFramework project contributors
// See LICENSE file in the project root for full license information.
//


#include "nf_rt_native.h"
#include <corlib_native.h>


HRESULT Library_nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility::GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
return Library_corlib_native_System_Resources_ResourceManager::GetObject___STATIC__OBJECT__SystemResourcesResourceManager__SystemEnum( stack );
}

HRESULT Library_nf_rt_native_nanoFramework_Runtime_Native_ResourceUtility::GetObject___STATIC__OBJECT__mscorlibSystemResourcesResourceManager__mscorlibSystemEnum__I4__I4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
return Library_corlib_native_System_Resources_ResourceManager::GetObject___STATIC__OBJECT__SystemResourcesResourceManager__SystemEnum__I4__I4( stack );
}