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

Eliminate WIN3264 macro instead of MSWIN #3932

Closed
wants to merge 8 commits into from

Conversation

h-east
Copy link
Contributor

@h-east h-east commented Feb 11, 2019

We use the existing WIN3264 macro instead.

Define FEAT_MSWIN and FEAT_GUI_MSWIN.

Use FEAT_MSWIN MSWIN instead of _WIN32, WIN32 and WIN3264.
Use FEAT_GUI_MSWIN instead of FEAT_GUI_W32.

We use the existing WIN3264 macro instead.
@codecov-io
Copy link

codecov-io commented Feb 11, 2019

Codecov Report

Merging #3932 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3932      +/-   ##
==========================================
- Coverage   79.13%   79.13%   -0.01%     
==========================================
  Files         105      105              
  Lines      141110   141110              
==========================================
- Hits       111670   111667       -3     
- Misses      29440    29443       +3
Impacted Files Coverage Δ
src/if_cscope.c 76.42% <ø> (ø) ⬆️
src/gui_gtk_x11.c 48.23% <ø> (-0.1%) ⬇️
src/if_ruby.c 90.29% <ø> (ø) ⬆️
src/normal.c 75.56% <ø> (ø) ⬆️
src/fileio.c 75.44% <ø> (ø) ⬆️
src/if_tcl.c 86.42% <ø> (ø) ⬆️
src/evalfunc.c 88.44% <ø> (ø) ⬆️
src/ex_cmds2.c 84.89% <ø> (ø) ⬆️
src/if_lua.c 85.33% <ø> (ø) ⬆️
src/ex_getln.c 76.01% <ø> (ø) ⬆️
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78d21da...df88908. Read the comment docs.

@brammool
Copy link
Contributor

brammool commented Feb 11, 2019 via email

@h-east h-east changed the title Eliminate MSWIN macro. Eliminate WIN3264 macro instead of MSWIN Feb 12, 2019
@mattn
Copy link
Member

mattn commented Feb 12, 2019

WIN32 is undocumented at least. Actually _WIN32 and _WIN64 is officially.

@mattn
Copy link
Member

mattn commented Feb 12, 2019

@h-east
Copy link
Contributor Author

h-east commented Feb 12, 2019

@mattn Thanks!

This microsoft site is written as follows.

  • _WIN32 Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined.

This means that the definition below is fine, right?

#ifdef _WIN32
# define MSWIN
#endif

Then, we can replace the part directly referencing WIN32 or _WIN32 with MSWIN, right?

@k-takata
Copy link
Member

I thought that defining WIN3264 was redundant, because it is exactly the same as _WIN32.
However, one merit for using WIN3264 is that it can avoid misunderstanding that _WIN32 doesn't includes _WIN64 (which is incorrect).
MSWIN was used for both Win16 and Win32, but we have already dropped the support for Win16.
So now MSWIN, WIN3264 and _WIN32 (and also WIN32) are all the same.

Using _WIN32 is a standard way in the Windows programming. So it is straightforward.
However, still there's a risk that someone misunderstands that it doesn't include _WIN64. Do we need to care such a case? If so, MSWIN might be better.

@k-takata
Copy link
Member

Bram's comment:
https://groups.google.com/d/msg/vim_dev/XsEQZnQr8Ck/StHpy92xAwAJ

It is best to separate the dependency on the compiler and Makefile from
what we use throughout Vim code. "MSWIN" is the easiest to understand
for all builds on MS-Windows. Then we can define it in one place in
vim.h, depending on _WIN32 or WIN32 (WIN32 is defined in all the
MS-Windows makefiles).

We can keep using _WIN64 for 64-bit specific code.

Okay, let's use MSWIN and _WIN64.
There is a part which uses WIN64 in evalfunc.c. It can be removed then.

BTW, we have also FEAT_GUI_W32 and FEAT_GUI_MSWIN.
FEAT_GUI_W32 is defined in the makefiles, and FEAT_GUI_MSWIN is defined in vim.h.
What do you think of this? Using FEAT_GUI_MSWIN is better?

@brammool
Copy link
Contributor

brammool commented Feb 13, 2019 via email

@h-east
Copy link
Contributor Author

h-east commented Feb 13, 2019

All right. Thank you!
I have been busy for a few days, so I will work on weekends.
(Unofficial 30% rule can not be used! 😁)

--
Best regards,
Hirohito Higashi (h_east)

@h-east
Copy link
Contributor Author

h-east commented Feb 17, 2019

I have a question.
Do we still need to support Make_ivc.mak?

@k-takata
Copy link
Member

Recent versions of Visual Studio cannot open Make_ivc.mak (and also Make_dvc.mak).
I don't think we still need to support them. But is it related to this PR?

@h-east
Copy link
Contributor Author

h-east commented Feb 17, 2019

Yes. We need s/FEAT_GUI_W32/FEAT_GUI/g in Make_ivc.mak

Use FEAT_MSWIN instead of _WIN32, WIN32 and WIN3264.
Use FEAT_GUI_MSWIN instead of FEAT_GUI_W32.
@brammool
Copy link
Contributor

Let me know when this is ready to include.

@h-east
Copy link
Contributor Author

h-east commented Feb 17, 2019

My work has been completed, but the impact range is large,
I'm happy if you can have reviews by various people.

@h-east
Copy link
Contributor Author

h-east commented Feb 17, 2019

@mattn, @ntak and Windows developers:
JFYI, Use FEAT_MSWIN MSWIN instead of WIN3264, WIN32 and _WIN32.
And also use FEAT_GUI_MSWIN instead of FEAT_GUI_W32.

Reason:
#3932 (comment)
#3932 (comment)

@brammool brammool closed this in 4f97475 Feb 17, 2019
@k-takata
Copy link
Member

Hmm, you defined FEAT_GUI_MSWIN and FEAT_GUI differently with other platforms.
In other platforms, FEAT_GUI_GTK or other platform-specific macros are defined in each makefile, and FEAT_GUI is defined in vim.h. However you defined FEAT_GUI in Windows makefiles, and FEAT_GUI_MSWIN in vim.h. They are reversed.

@k-takata
Copy link
Member

JFYI, Use FEAT_MSWIN instead of WIN3264, WIN32 and _WIN32.

s/FEAT_MSWIN/MSWIN/

@h-east h-east deleted the eliminate_MSWIN_macro branch February 17, 2019 23:27
@h-east
Copy link
Contributor Author

h-east commented Feb 18, 2019

They are reversed.

Thank you for your advice.
Indeed, the opposite is true.
I will PR later.

kylo252 added a commit to kylo252/neovim that referenced this pull request Jan 21, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
kylo252 added a commit to kylo252/neovim that referenced this pull request Jan 21, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
dundargoc added a commit to dundargoc/neovim that referenced this pull request Sep 16, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
dundargoc added a commit to dundargoc/neovim that referenced this pull request Sep 16, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
dundargoc added a commit to dundargoc/neovim that referenced this pull request Sep 16, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
dundargoc added a commit to dundargoc/neovim that referenced this pull request Sep 16, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
dundargoc added a commit to dundargoc/neovim that referenced this pull request Sep 16, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
zeertzjq pushed a commit to neovim/neovim that referenced this pull request Sep 18, 2022
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
lvimuser pushed a commit to lvimuser/neovim that referenced this pull request Oct 6, 2022
)

Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
vim/vim@4f97475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants