-
Notifications
You must be signed in to change notification settings - Fork 45
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
Support for EventToken.h on mingw64 #45
Comments
Thanks for your detailed description! I agree that I've checked my Ubuntu 22.04 environment and mingw-w64 doesn't have the header there; however, on Ubuntu 24.04 the header is located at I believe the I can pull a few ideas with varied quality from the top of my head:
I'm not originally a Go developer so ideas are much appreciated. |
I see the webview project has this file: https://github.com/webview/webview/blob/93be13a101e548c13d47ae36a6ea00300b2ecfc0/webview_mingw_support.h #ifndef WEBVIEW_MINGW_SUPPORT_H
#define WEBVIEW_MINGW_SUPPORT_H
#ifdef _WIN32
// Some MinGW distributions do not have the EventToken.h header (used by WebView2).
// Define the things used by WebView2 from the EventToken.h header if needed.
#if defined(__has_include)
#if !defined(WEBVIEW_HAVE_EVENTTOKEN_H) && __has_include(<EventToken.h>)
#include <EventToken.h>
#define WEBVIEW_HAVE_EVENTTOKEN_H
#endif
#if !defined(WEBVIEW_HAVE_EVENTTOKEN_H) && defined(__eventtoken_h__)
#define WEBVIEW_HAVE_EVENTTOKEN_H
#endif
#if !defined(WEBVIEW_HAVE_EVENTTOKEN_H)
#include <cstdint>
typedef struct EventRegistrationToken {
int64_t value;
} EventRegistrationToken;
#endif
#endif
#endif /* _WIN32 */
#endif /* WEBVIEW_MINGW_SUPPORT_H */ It looks like there is some kind of Your thought process in this pull request feels like it could work for the go binding as well: webview/webview#957 I'm just not sure how this would be done. If a custom EventToken.h is kept alongside WebView2.h, then it will probably always be included due to the |
@SteffenL Sorry for bringing this up again, because I know you have answered this question so many times:
I have a suggestion that might add better support for mingw64. Here are a few examples I want to present:
Here is a screenshot of the file on my local system:
The associated verbose build output:
The important part in the above output is the additional header location added via
-I/nix/store/57s2nhck96xz82vpdq92jkii9c1q2bdq-mingw-w64-x86_64-w64-mingw32-11.0.1-headers/include
, so thateventtoken.h
will be available for include.It looks like the convention for referencing the
"EventToken.h"
header with the mingw-64 compilation toolchain, is to use lowercase, e.g.<eventtoken.h>
. The Windows API docs itself also refers to this header in lowercase. However, searching GitHub, I can see that both variants are used.What I'm trying to figure out, is whether this generated file (https://github.com/webview/webview_go/blob/master/libs/mswebview2/include/WebView2.h) could somehow be patched to use a lowercase include of
eventtoken.h
, and whether that would still work for non-mingw builds.@SteffenL Do you have insight in how WebView2.h is generated and whether somewhere in the process a lowercase include of
eventtoken.h
can be used (if not for every toolchain, then specifically for the mingw toolchain)?The text was updated successfully, but these errors were encountered: