Skip to content

Commit

Permalink
ELENAVM : display if VM is 32 or 64 bit on Windows? #680 (#681)
Browse files Browse the repository at this point in the history
* Update README.md
* ELENAVM : display if VM is 32 or 64 bit on Windows? #680
* fixed string type
* finall fixes (ocp for getArchitectureName())
---------

Co-authored-by: Aleksey Rakov <[email protected]>
  • Loading branch information
YairBybabayov and arakov authored Aug 11, 2024
1 parent 510ae41 commit e50a23c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ The ELENA source code is organized as follows:
## Community
We want your contributions and suggestions! One of the easiest ways to contribute is to participate in Github discussions or on Discord.

Please take a look at our [contributor page](https://github.com/ELENA-LANG/elena-lang/wiki/Getting-Started-with-the-project)

### 1. Bugs, questions, suggestions?

If you've noticed a bug or have a question go ahead and [make one](https://github.com/ELENA-LANG/elena-lang/issues/new/choose)!
Expand Down
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__)

This comment has been minimized.

Copy link
@bencz

bencz Aug 12, 2024

Member

__aarch64__ is missing

This comment has been minimized.

Copy link
@arakov

arakov Aug 15, 2024

Author Member

Good catch. I will fix

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

0 comments on commit e50a23c

Please sign in to comment.