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 MSVC/Visual Studio build #1957

Merged
merged 2 commits into from
Nov 27, 2018
Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Nov 27, 2018

Unfortunately, the recent restructuring of the environment handling had an unexpected fallout: the wmain() function was not actually used in the MSVC build, but the main() function was picked up instead, and therefore not only was the environment not handled as we wanted, but the _wpgmptr variable was initialized to NULL and not pointing to the absolute path of the current executable, causing a segmentation fault (reported by @benpeart).

This PR fixes that.

after adjusting the MSVC linker flags to force it to use wmain().

Noticed by Ben Peart.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…ersions

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho requested a review from benpeart November 27, 2018 22:30
Copy link

@benpeart benpeart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this version and it solved the problem. Thanks!

@dscho dscho merged commit 00305f0 into git-for-windows:master Nov 27, 2018
@dscho dscho deleted the fix-msvc-build branch November 27, 2018 22:39
dscho added a commit to dscho/git that referenced this pull request Nov 27, 2018
@dscho dscho added this to the v2.19.2(2) milestone Nov 27, 2018
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