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

Fix: change defined WIN32 #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix: change defined WIN32 #11

wants to merge 3 commits into from

Conversation

Jamaika1
Copy link

No description provided.

@OgreTransporter
Copy link

Let's look at a truth table:

i WIN32 WIN64 GNUC A B
1 false false 3 true true
2 false true 3 false true
3 true false 3 false true
4 true true 3 false false
5 false false 4 true true
6 false true 4 false true
7 true false 4 false true
8 true true 4 false true

A: !defined(_WIN32) && !defined(_WIN64)
B: ((!defined(_WIN32) || !defined(_WIN64)) || __GNUC__ > 3)

For MSVC the expression __GNUC__ > 3 is always false. This means that A and B must be identical in the first four lines - otherwise the result is wrong!

@Jamaika1
Copy link
Author

Jamaika1 commented May 27, 2020

OK. Change the expression A and B is identical

@OgreTransporter
Copy link

Are you sure this is right?

B: #if ((!defined(_WIN32) && !defined(_WIN64)) || (defined(__MINGW32__) && defined(__MINGW64__))) /* The following definition is applicable only for non-windows platform */

WIN32 WIN64 MINGW32 MINGW64 A B
false false false false true true
true false false false false false
false true false false false false
true true false false false false
false false true false true true
true false true false false false
false true true false false false
true true true false false false
false false false true true true
true false false true false false
false true false true false false
true true false true false false
false false true true true true
true false true true false true
false true true true false true
true true true true false true

@Jamaika1
Copy link
Author

Jamaika1 commented May 28, 2020

I understand that the query is for the last three lines.
In my opinion: if MINGW32 is true, !WIN32 is always false.
If MINGW64 is true, !WIN64 is always false.
I don't know how is it for other platforms? No windows and no mingw.

@pawankishorsingh pawankishorsingh changed the base branch from master to main August 11, 2020 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants