Skip to content

Conversation

@rkanavath
Copy link
Contributor

to be merged after #350

This is not a search and replace of __MING32__ with _WIN32.
There are places where __MINGW32__ is still used and all changes are
tested with MSVC 2019 compiler. Although, this commit alone will not work
on MSVC because there are plenty of other things to be done which are
seperated into multiple PR. PR OSGeo#289 is the one that "works" on MSVC and
unix as well. But that contains too many changes which shouldn't in a single
PR. Even though this PR alone won't compile GRASS GIS on MSVC, it sure will
not break existing compilers which I think is very important.

Complete support for MSVC will be ready after 2/3 PRs

OSGeo#289
static int initialized is not working for MSVC
and must export this with __declspec so that it appears in a DLL
correctly. This change has been tested on Ubuntu and MSVC 2019 and
is working as expected.
Below is a code from filldepr.cpp which throws error on msvc compiler
function has G_fatal_error() so it is 'normal' to have no return type.
But MSVC complains that function's return type is elevation_type*
and does not return anything.

elevation_type*
ext_fill_depression(AMI_STREAM<boundaryType> *boundaryStr,
			 cclabel_type maxWatersheds) {
  G_fatal_error(_("Fill_depressions do not fit in memory. Not implemented yet"));
}
@rkanavath rkanavath mentioned this pull request Feb 18, 2020
@rkanavath rkanavath changed the title [WIP] Support msvc 2 Support msvc 2 Mar 2, 2020
@neteler neteler added enhancement New feature or request windows Microsoft Windows specific labels Dec 9, 2021
@neteler neteler added this to the 8.2.0 milestone Dec 9, 2021
@wenzeslaus wenzeslaus modified the milestones: 8.2.0, 8.4.0 Feb 27, 2022
@wenzeslaus wenzeslaus modified the milestones: 8.3.0, 8.4.0 Feb 10, 2023
@wenzeslaus wenzeslaus modified the milestones: 8.4.0, Future Apr 26, 2024
@wenzeslaus
Copy link
Member

I don't know what are the relevant changes here (all these old msvc PRs were done from different places on a branch with previous changes accumulated - that's partially why we were never able to review them and merge them).

I suggest closing this when CMake build works on Windows.

@echoix
Copy link
Member

echoix commented Feb 19, 2025

It's the last 6 commits that follow #350, on a computer, on files changed, you can filter by commit and use shift+click to select a range of commits to show the changed files of

Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

I reviewed the changes that are after the branch mentioned (last 6 commits). There's only one include in raster/r.viewshed/statusstructure.cpp that isn't in main already

Comment on lines +25 to +27
#ifdef _MSC_VER
#pragma warning(default:4716)
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Included in #3621, but with #pragma warning(default : 4716) instead.

#include <stdlib.h>
#include <assert.h>

#include <algorithm>
Copy link
Member

Choose a reason for hiding this comment

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

Not included in main branch as of 2025-04-26

@echoix echoix requested a review from HuidaeCho May 22, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request windows Microsoft Windows specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants