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 gcc builds failing on Windows #79724

Merged
merged 1 commit into from Jul 24, 2023

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Jul 20, 2023

Addresses 3 seperate errors/failings that occured for me when trying to build on windows with mingw

platform\windows\gl_manager_windows.cpp: In member function 'void GLManager_Windows::_nvapi_disable_threaded_optimization()':
platform\windows\gl_manager_windows.cpp:118:32: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void* (*)(unsigned int)' [-Werror=cast-function-type]
  118 |         NvAPI_QueryInterface = (void *(__cdecl *)(unsigned int))GetProcAddress(nvapi, "nvapi_QueryInterface");
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A define existed for wglGetProcAddress, but not GetProcAddress like most other Windows files; that's now fixed

platform\windows\display_server_windows.cpp: In member function 'virtual void DisplayServerWindows::set_icon(const Ref<Image>&)':
platform\windows\display_server_windows.cpp:2412:83: error: passing NULL to non-pointer argument 4 of 'LRESULT SendMessageA(HWND, UINT, WPARAM, LPARAM)' [-Werror=conversion-null]
 2412 |                 SendMessage(windows[MAIN_WINDOW_ID].hWnd, WM_SETICON, ICON_SMALL, NULL);
      |                                                                                   ^~~~

Typecasting the NULL values as (LPARAM)NULL fixed the errors

'C:/Tools/msys64/mingw64/bin/x86_64-w64-mingw32-objcopy' is not recognized as an internal or external command,
operable program or batch file.
'C:/Tools/msys64/mingw64/bin/x86_64-w64-mingw32-strip' is not recognized as an internal or external command,
operable program or batch file.
'C:/Tools/msys64/mingw64/bin/x86_64-w64-mingw32-objcopy' is not recognized as an internal or external command,
operable program or batch file.

Not technically an error, but .debugsymbols files weren't properly generating because objcopy and strip don't have any prefix. Passing an empty arch value returns the expected path but with no erroneous prefix

@Repiteo Repiteo requested a review from a team as a code owner July 20, 2023 21:00
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

because objcopy and strip don't have any prefix.

In many cases they do, it depends on distribution, so code probably should try both and check if files exist.

@Repiteo
Copy link
Contributor Author

Repiteo commented Jul 20, 2023

In many cases they do, it depends on distribution, so code probably should try both and check if files exist.

Oh! Didn't realize that was a possibility, good to know; I'll adjust accordingly

@Repiteo
Copy link
Contributor Author

Repiteo commented Jul 20, 2023

Adjusting the Python to check for multiple files is a bit beyond the scope of what I expected to do this PR, so I'll leave the old version as-is considering it's functional on most distributions

@YuriSizov YuriSizov merged commit c8e191b into godotengine:master Jul 24, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov YuriSizov changed the title Fix gcc builds failing on windows Fix gcc builds failing on Windows Jul 24, 2023
@Repiteo Repiteo deleted the gcc-windows-fixes branch July 24, 2023 19:20
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

4 participants