emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3bf5c2a838: Stop relying on dynlib for PGTK interrupt input


From: Po Lu
Subject: master 3bf5c2a838: Stop relying on dynlib for PGTK interrupt input
Date: Mon, 14 Mar 2022 20:55:47 -0400 (EDT)

branch: master
commit 3bf5c2a8381c9dac54c88c264091b94847abf1c3
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Stop relying on dynlib for PGTK interrupt input
    
    * src/pgtkterm.c (pgtk_term_init): Use dlopen and dlsym directly
    instead of dynlib functions.  (bug#54378)
---
 src/pgtkterm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index abcf18e11d..9f9768cf2a 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -36,6 +36,8 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <c-strcase.h>
 #include <ftoastr.h>
 
+#include <dlfcn.h>
+
 #include "lisp.h"
 #include "blockinput.h"
 #include "frame.h"
@@ -47,7 +49,6 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include "fontset.h"
 #include "composite.h"
 #include "ccl.h"
-#include "dynlib.h"
 
 #include "termhooks.h"
 #include "termopts.h"
@@ -6545,8 +6546,8 @@ pgtk_term_init (Lisp_Object display_name, char 
*resource_name)
   static int x_initialized = 0;
   static unsigned x_display_id = 0;
   static char *initial_display = NULL;
-  static dynlib_handle_ptr *handle = NULL;
   char *dpy_name;
+  static void *handle = NULL;
   Lisp_Object lisp_dpy_name = Qnil;
 
   block_input ();
@@ -6720,15 +6721,15 @@ pgtk_term_init (Lisp_Object display_name, char 
*resource_name)
   dpyinfo->connection = -1;
 
   if (!handle)
-    handle = dynlib_open (NULL);
+    handle = dlopen (NULL, RTLD_LAZY);
 
 #ifdef GDK_WINDOWING_X11
   if (!strcmp (G_OBJECT_TYPE_NAME (dpy), "GdkX11Display") && handle)
     {
       void *(*gdk_x11_display_get_xdisplay) (GdkDisplay *)
-       = dynlib_sym (handle, "gdk_x11_display_get_xdisplay");
+       = dlsym (handle, "gdk_x11_display_get_xdisplay");
       int (*x_connection_number) (void *)
-       = dynlib_sym (handle, "XConnectionNumber");
+       = dlsym (handle, "XConnectionNumber");
 
       if (x_connection_number
          && gdk_x11_display_get_xdisplay)
@@ -6742,7 +6743,7 @@ pgtk_term_init (Lisp_Object display_name, char 
*resource_name)
     {
       struct wl_display *wl_dpy = gdk_wayland_display_get_wl_display (dpy);
       int (*display_get_fd) (struct wl_display *)
-       = dynlib_sym (handle, "wl_display_get_fd");
+       = dlsym (handle, "wl_display_get_fd");
 
       if (display_get_fd)
        dpyinfo->connection = display_get_fd (wl_dpy);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]