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

Revert main.cpp SDL includes #27755

Merged
merged 1 commit into from
Jan 22, 2019

Conversation

jbytheway
Copy link
Contributor

@jbytheway jbytheway commented Jan 21, 2019

Summary

SUMMARY: None

Purpose of change

Trying to fix MSYS linking error reported here.

Describe the solution

Revert part of 595a7e9. It's not safe for main.cpp to include all SDL headers because they #define WinMain. So switch back to just including SDL_version.h.

Additional context

Untested, because I don't have access to the relevant build environment. @ZhilkinSerg can you check if this fixes the issue?

Revert part of 595a7e9.  It's not safe for main.cpp to include all SDL
headers because they #define WinMain.  So switch back to just including
SDL_version.h.
@ZhilkinSerg ZhilkinSerg added OS: Windows Issues related to Windows operating system SDL: Tiles / Sound Tiles visual interface and sounds. <Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments labels Jan 21, 2019
@ZhilkinSerg
Copy link
Contributor

Yeah, it works both on MSYS and VS.

These headers are required for following code and I guess we can try to put SDL version report to sdl_wrappers.h later:

#ifdef TILES
    SDL_version compiled;
    SDL_VERSION( &compiled );
    DebugLog( D_INFO, DC_ALL ) << "SDL version used during compile is "
                               << static_cast<int>( compiled.major ) << "."
                               << static_cast<int>( compiled.minor ) << "."
                               << static_cast<int>( compiled.patch );

    SDL_version linked;
    SDL_GetVersion( &linked );
    DebugLog( D_INFO, DC_ALL ) << "SDL version used during linking and in runtime is "
                               << static_cast<int>( linked.major ) << "."
                               << static_cast<int>( linked.minor ) << "."
                               << static_cast<int>( linked.patch );
#endif

@jbytheway
Copy link
Contributor Author

These headers are required for following code and I guess we can try to put SDL version report to sdl_wrappers.h later:

I'd propose: make a new header (or find a suitable existing header -- but it has to be one that doesn't include sdl_wrappers.h) to declare a new function (e.g. report_sdl_version) and call that from main.cpp. The definition of that new function can be in some other file which includes sdl_wrappers.h without polluting main.cpp.

@ZhilkinSerg ZhilkinSerg merged commit 4cf95cf into CleverRaven:master Jan 22, 2019
@jbytheway jbytheway deleted the fix_msys_linking branch January 22, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants