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

ELENAVM : display if VM is 32 or 64 bit on Windows? #680 fixed string types #682

Closed
wants to merge 4 commits into from
Closed
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
12 changes: 10 additions & 2 deletions elenasrc3/elenavm/elenavmmachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,19 @@ ELENAVMMachine :: ELENAVMMachine(path_t configPath, PresenterBase* presenter, Pl
_jitLinker = nullptr;
}

ustr_t ELENAVMMachine::getArchitectureName() {
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
return "64-bit";
#else
return "32-bit";
#endif
}

void ELENAVMMachine :: init(SystemEnv* exeEnv)
{
assert(_initialized == false);

_presenter->printLine(ELENAVM_GREETING, ENGINE_MAJOR_VERSION, ENGINE_MINOR_VERSION, ELENAVM_REVISION_NUMBER);
ustr_t architecture = getArchitectureName();
_presenter->printLine(ELENAVM_GREETING, ENGINE_MAJOR_VERSION, ENGINE_MINOR_VERSION, ELENAVM_REVISION_NUMBER, architecture);
_presenter->printLine(ELENAVM_INITIALIZING);

_configuration->initLoader(_libraryProvider);
Expand Down
1 change: 1 addition & 0 deletions elenasrc3/elenavm/elenavmmachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace elena_lang

virtual void resumeVM(SystemEnv* env, void* criricalHandler);

ustr_t getArchitectureName();
void init(SystemEnv* env);

AddressMap::Iterator externals() override;
Expand Down
2 changes: 1 addition & 1 deletion elenasrc3/elenavm/vmcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace elena_lang
{
constexpr auto ELENAVM_GREETING = "ELENA VM %d.%d.%d (C)2022-2024 by Aleksey Rakov";
constexpr auto ELENAVM_GREETING = "ELENA VM %d.%d.%d (%s) (C)2022-2024 by Aleksey Rakov";

constexpr auto ELENAVM_INITIALIZING = "Initializing...";
}
Expand Down
1 change: 1 addition & 0 deletions elenasrc3/engine/elena.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ namespace elena_lang
virtual void printLine(ustr_t msg, int arg1) = 0;
virtual void printLine(ustr_t msg, int arg1, int arg2) = 0;
virtual void printLine(ustr_t msg, int arg1, int arg2, int arg3) = 0;
virtual void printLine(ustr_t msg, int arg1, int arg2, int arg3, ustr_t arg4) = 0; //version support print
virtual void printLine(ustr_t msg, ustr_t arg1, int arg2, int arg3, ustr_t arg4) = 0;
virtual void printPathLine(ustr_t msg, path_t arg) = 0;
virtual void printPathLine(ustr_t msg, path_t arg1, int arg2, int arg3, ustr_t arg4) = 0;
Expand Down
8 changes: 8 additions & 0 deletions elenasrc3/engine/windows/presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ void WinConsolePresenter :: printLine(ustr_t msg, int arg1, int arg2, int arg3)
::printLine(wstr.str(), arg1, arg2, arg3);
}

void WinConsolePresenter::printLine(ustr_t msg, int arg1, int arg2, int arg3, ustr_t arg4) //version support print
{
WideMessage wstr(msg);
WideMessage warg4(arg4);

::printLine(wstr.str(), arg1, arg2, arg3, warg4.str());
}

void WinConsolePresenter :: printPathLine(ustr_t msg, path_t arg1, int arg2, int arg3, ustr_t arg4)
{
WideMessage wstr(msg);
Expand Down
2 changes: 2 additions & 0 deletions elenasrc3/engine/windows/presenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace elena_lang
void printLine(ustr_t msg, ustr_t arg1, ustr_t arg2) override;
void printLine(ustr_t msg, ustr_t arg1, ustr_t arg2, ustr_t arg3) override;
void printLine(ustr_t msg, int arg1, int arg2, int arg3) override;
void printLine(ustr_t msg, int arg1, int arg2, int arg3, ustr_t arg4) override; //version support print

void printPathLine(ustr_t msg, path_t arg1, int arg2, int arg3, ustr_t arg4) override;
void printLine(ustr_t msg, int arg1) override;
void printLine(ustr_t msg, int arg1, int arg2) override;
Expand Down
Loading