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

Add a (void*) cast to GetProcAddress #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomrittervg
Copy link

Visual C++ has an extension that auto-magically converts a FARPROC to a void*.
On MinGW we get an error like:

In function ‘void* SharedLib_GetFunction(SharedLibHandle, const char*)’:
openvr/src/sharedlibtools_public.cpp:25:23: error: invalid conversion from ‘FARPROC {aka int (attribute((stdcall)) )()}’ to ‘void’ [-fpermissive]
return GetProcAddress( (HMODULE)lib, pchFunctionName );

See also http://stackoverflow.com/questions/13958081/mingw-compile-error-invalid-conversion-from-farproc-to-void-but-msvc-com

Visual C++ has an extension that auto-magically converts a FARPROC to a void*.
On MinGW we get an error like:

In function ‘void* SharedLib_GetFunction(SharedLibHandle, const char*)’:
   openvr/src/sharedlibtools_public.cpp:25:23: error: invalid conversion from ‘FARPROC {aka int (__attribute__((__stdcall__)) *)()}’ to ‘void*’ [-fpermissive]
   return GetProcAddress( (HMODULE)lib, pchFunctionName );

See also http://stackoverflow.com/questions/13958081/mingw-compile-error-invalid-conversion-from-farproc-to-void-but-msvc-com
@natbro
Copy link
Contributor

natbro commented May 8, 2017

thanks - good fix - we'll fold this into the next drop & close it then after you confirm.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 26, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY

--HG--
extra : rebase_source : 747b14607d2acad92672085e390b8dd6d4678a46
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request May 26, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY
Manishearth pushed a commit to Manishearth/gecko-dev that referenced this pull request May 27, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this pull request May 30, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 12, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY

--HG--
extra : rebase_source : 7c712bf64cfedd9d895083f8f3111b41850c30ff
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this pull request Jul 13, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request Jul 14, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY
Manishearth pushed a commit to Manishearth/gecko-dev that referenced this pull request Jul 15, 2017
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 4d867f09f117e91d66f2fb676ae0ed739544c58e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 4d867f09f117e91d66f2fb676ae0ed739544c58e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 4d867f09f117e91d66f2fb676ae0ed739544c58e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 119016ae9f2b948c9f497cee972b03650db0f97c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 119016ae9f2b948c9f497cee972b03650db0f97c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
This involved four commits:
- Windows.h -> windows.h and similar ValveSoftware/openvr#508
- Add a void* cast for a farproc auto-conversion ValveSoftware/openvr#509
- Add share.h ValveSoftware/openvr#510
- Use GCC Variadic Macros ValveSoftware/openvr#511

This is a reapply of Bug 1363173. Hopefully Valve will actually include the patches in the next release.

MozReview-Commit-ID: KC7Z3r8qSUY

UltraBlame original commit: 119016ae9f2b948c9f497cee972b03650db0f97c
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