summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2025-04-30 07:14:23 -0400
committerEli Zaretskii <eliz@gnu.org>2025-04-30 07:14:23 -0400
commit6bb3c6f9e181bb0279457c4f74b86fae03a4c68c (patch)
tree1bd7a65b166a8675ef3ca274c8e124977ec01906 /lib-src
parent606e7b73bacb282d3de0d626c9c62281cde4ea57 (diff)
parentcc5b1a01a2c20e48fc4469cf0efd2bea7731ce58 (diff)
Merge from origin/emacs-30
cc5b1a01a2c ; * doc/misc/efaq-w32.texi (Location of init file): Fix a... 6c2aaedfceb Fix compilation errors in emacsclient.c with MinGW GCC 15 d56e5ba97ee ; * etc/DEBUG: Add link to GCC bug #78685. 80cbd1e31cc ; Fix key notation in Introduction to Emacs Lisp 1224e5fd961 ; * lisp/files.el (revert-buffer-restore-functions): Doc ... 79e7eeb3296 ; Improve documentation of 'format-time-string' 2838b64fc8b ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix ... 9adb05422ea ; Improve obsolescence of 'text-mode-variant' 4858d818488 ; * lisp/files.el (revert-buffer-restore-functions): Doc ... 2a8e223b8d7 ; Mention early-init file in Emacs FAQ for Windows 14c707b42d9 ; Isearch: Fix key bindings in docstrings
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index eb98ef6c6e7..801e6f22101 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1715,8 +1715,13 @@ set_socket (bool no_exit_if_error)
}
#ifdef HAVE_NTGUI
-FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
-FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
+typedef void (* VOIDFNPTR) (void);
+typedef BOOL (WINAPI *AllowSetForegroundWindow_proc) (DWORD);
+/* Pointer to AllowSetForegroundWindow. */
+static AllowSetForegroundWindow_proc set_fg;
+typedef UINT (WINAPI *RealGetWindowClassA_proc) (HWND, LPSTR, UINT);
+/* Pointer to RealGetWindowClassA. */
+static RealGetWindowClassA_proc get_wc;
void w32_set_user_model_id (void);
@@ -1794,8 +1799,8 @@ w32_give_focus (void)
emacsclient can allow Emacs to grab the focus by calling the function
AllowSetForegroundWindow. Unfortunately, older Windows (W95, W98 and
NT) lack this function, so we have to check its availability. */
- if ((set_fg = GetProcAddress (user32, "AllowSetForegroundWindow"))
- && (get_wc = GetProcAddress (user32, "RealGetWindowClassA")))
+ if ((set_fg = (AllowSetForegroundWindow_proc) (VOIDFNPTR) GetProcAddress (user32, "AllowSetForegroundWindow"))
+ && (get_wc = (RealGetWindowClassA_proc) (VOIDFNPTR) GetProcAddress (user32, "RealGetWindowClassA")))
EnumWindows (w32_find_emacs_process, (LPARAM) 0);
}
#endif /* HAVE_NTGUI */