Skip to content

Commit

Permalink
Fixes for the linker and bring to version .NET Core 7.
Browse files Browse the repository at this point in the history
TODO:
-- Need to verify the linker libraries part
-- Need to create project specific settings (for where to load the dlls from etc)
-- Need to create Spartan.SDK (methods, structs) to allow for hooks and calls for every tick etc.
  • Loading branch information
NickPolyder committed Dec 4, 2023
1 parent 487f87b commit 2a0fae4
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
1 change: 1 addition & 0 deletions runtime/Scripting/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//= INCLUDES ===============
#include "pch.h"
#include "ScriptEngine.h"

//==========================

//= NAMESPACES ===============
Expand Down
37 changes: 36 additions & 1 deletion runtime/Scripting/hostfxr.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef void(HOSTFXR_CALLTYPE *hostfxr_error_writer_fn)(const char_t *message);
// By default no callback is registered in which case the errors are written to stderr.
//
// Each call to the error writer is sort of like writing a single line (the EOL character is omitted).
// Multiple calls to the error writer may occure for one failure.
// Multiple calls to the error writer may occur for one failure.
//
// If the hostfxr invokes functions in hostpolicy as part of its operation, the error writer
// will be propagated to hostpolicy for the duration of the call. This means that errors from
Expand All @@ -88,6 +88,8 @@ struct hostfxr_initialize_parameters
// Number of argv arguments
// argv
// Command-line arguments for running an application (as if through the dotnet executable).
// Only command-line arguments which are accepted by runtime installation are supported, SDK/CLI commands are not supported.
// For example 'app.dll app_argument_1 app_argument_2`.
// parameters
// Optional. Additional parameters for initialization
// host_context_handle
Expand Down Expand Up @@ -285,4 +287,37 @@ typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_get_runtime_delegate_fn)(
//
typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_close_fn)(const hostfxr_handle host_context_handle);

struct hostfxr_dotnet_environment_sdk_info
{
size_t size;
const char_t* version;
const char_t* path;
};

typedef void(HOSTFXR_CALLTYPE* hostfxr_get_dotnet_environment_info_result_fn)(
const struct hostfxr_dotnet_environment_info* info,
void* result_context);

struct hostfxr_dotnet_environment_framework_info
{
size_t size;
const char_t* name;
const char_t* version;
const char_t* path;
};

struct hostfxr_dotnet_environment_info
{
size_t size;

const char_t* hostfxr_version;
const char_t* hostfxr_commit_hash;

size_t sdk_count;
const struct hostfxr_dotnet_environment_sdk_info* sdks;

size_t framework_count;
const struct hostfxr_dotnet_environment_framework_info* frameworks;
};

#endif //__HOSTFXR_H__
4 changes: 2 additions & 2 deletions runtime/Scripting/nethost.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Consuming the nethost as a static library
// Shouldn't export attempt to dllimport.
#ifdef NETHOST_USE_AS_STATIC
#define NETHOST_API
#define NETHOST_API
#else
#define NETHOST_API __declspec(dllimport)
#endif
Expand Down Expand Up @@ -77,7 +77,7 @@ struct get_hostfxr_parameters {
//
// get_hostfxr_parameters
// Optional. Parameters that modify the behaviour for locating the hostfxr library.
// If nullptr, hostfxr is located using the enviroment variable or global registration
// If nullptr, hostfxr is located using the environment variable or global registration
//
// Return value:
// 0 on success, otherwise failure
Expand Down
Binary file added third_party/dotnet/nethost.dll
Binary file not shown.
Binary file added third_party/dotnet/nethost.lib
Binary file not shown.

0 comments on commit 2a0fae4

Please sign in to comment.