minoca / os

Minoca operating system
Other
2.71k stars 232 forks source link

Changes to build in Visual Studio #155

Closed Alexcolom closed 4 years ago

Alexcolom commented 5 years ago

There are difficulties with the apps\swiss\sh\shntos.c file for swiss.exe. The compiler includes the <sys /types.h> file with the tools\win32\MinGW\include path, so I have to redefine the POINTER_ADD macro. In addition, UINTN is not defined. The size of a "long" and a "int" integer in msvc x64 is 4 bytes. but in gcc x64 it is 8 bytes.

Alexcolom commented 5 years ago

A few more thoughts about the apps\swiss\sh\shntos.c file. Now swiss.exe is built on an x32 system, and there will be no problems with the size of long and int, but things can change in the future. Since my PVOID is defined as char *, adding pointers of the following form will suit me: BytesRead = read(OutputContext->Handle, (PVOID)OutputContext->Buffer + OutputContext->BufferSize, ... It looks a bit ugly and i hopefully you offer a better solution.

Alexcolom commented 5 years ago

Hi Evan, Thank you for your advice. I think I understood how  work command of git rebase. It seems that I took into account all your wishes. Sincerely, Olexander.

6 января 2019, 21:06:09, от "Evan Green" notifications@github.com:

@evangreen requested changes on this pull request. Thanks for creating this. You can use git rebase -i to edit these commits and then force push to the same branch in order to update this pull request, rather than closing it and starting a new one. In apps/swiss/sh/shntos.c:

@@ -41,6 +41,18 @@ Module Name:

include

include "shos.h"

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition of pointers with type PVOID in Visual Studio. +// +// + +#define POINTER_ADD(_Base, _Addition) \

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition of pointers with type PVOID in Visual Studio. +// Remove this extra // line. In apps/libc/include/sys/types.h:

@@ -32,6 +32,20 @@ Module Name:

include

include

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition and subtraction of pointers with type PVOID in Visual Studio. Please make sure none of your changes extend beyond 80 columns. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Alexcolom commented 5 years ago

And tell me, please, how do you know that a rebase has occurred in the pool request? Olexandr.

8 января 2019, 12:48:00, от "Александр Коломиец" myos@ukr.net:

Hi Evan, Thank you for your advice. I think I understood how  work command of git rebase. It seems that I took into account all your wishes. Sincerely, Olexander.

6 января 2019, 21:06:09, от "Evan Green" notifications@github.com:

@evangreen requested changes on this pull request. Thanks for creating this. You can use git rebase -i to edit these commits and then force push to the same branch in order to update this pull request, rather than closing it and starting a new one. In apps/swiss/sh/shntos.c:

@@ -41,6 +41,18 @@ Module Name:

include

include "shos.h"

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition of pointers with type PVOID in Visual Studio. +// +// + +#define POINTER_ADD(_Base, _Addition) \

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition of pointers with type PVOID in Visual Studio. +// Remove this extra // line. In apps/libc/include/sys/types.h:

@@ -32,6 +32,20 @@ Module Name:

include

include

+// +// --------------------------------------------------------------------- Macros +// + +// +// Macros for operations of addition and subtraction of pointers with type PVOID in Visual Studio. Please make sure none of your changes extend beyond 80 columns. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

evangreen commented 5 years ago

Ah, I understand. I will take a look. Thanks!

evangreen commented 5 years ago

Are you sure MSVC doesn't support hex float constants? On godbolt.com, I can create this program:

double square() {
    return 0x1p127F;
}

And when I select MSVC it compiles fine. I also see this page, whose last answer makes it sound like it works. What version of MSVC are you using?

Alexcolom commented 5 years ago

My compiler version is Visual Studio 2015.

evangreen commented 5 years ago

Hi Olexandr, Like we talked about over email, I was planning on taking the POINTER_ADD commit. But then I just noticed that there are still lines over 80 characters, and there is also trailing whitespace. Perhaps your editor can be set to notify you of these things.

Also, will the POINTER_ADD changes be needed once you upgrade to VS 2017? Or were these only required for VS 2015?

evangreen commented 4 years ago

Seems like this has been abandoned.