summaryrefslogtreecommitdiffstats
path: root/source/a/gpm/gpm-1.20.1-weak-wgetch.patch
blob: cf10ee6b2bdd4dc6e97978b2d421bb9451cd4074 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- ./src/lib/libcurses.c.orig	2012-10-26 16:21:38.000000000 -0500
+++ ./src/lib/libcurses.c	2024-03-27 14:48:08.842064533 -0500
@@ -41,7 +41,12 @@
 #endif /* HAVE_NCURSES_CURSES_H */
 #endif /* HAVE_NCURSES_H */
 
-#define GET(win) ((win) ? wgetch(win) : getch())
+/* If win != NULL, it must have been created by ncurses anyway.
+   Avoid circular library dependencies.  */
+#pragma weak wgetch
+#pragma weak stdscr
+
+#define GET(win) ((win && wgetch) ? wgetch(win) : getch())
 
 int Gpm_Wgetch(WINDOW *win)
 {