Fix implicit declaration of functions, implicit int, some strict prototypes.
--- autoconf/config.h.in.orig	2003-02-19 18:35:55.000000000 -0600
+++ autoconf/config.h.in	2024-07-02 07:15:56.000000000 -0500
@@ -54,6 +54,15 @@
 /* Define to 1 if you have the `openpty' function. */
 #undef HAVE_OPENPTY
 
+/* Define to 1 if you have the <libutil.h> header file. */
+#undef HAVE_LIBUTIL_H
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
 /* Define to 1 if you have the `revoke' function. */
 #undef HAVE_REVOKE
 
--- configure.orig	2003-03-26 00:07:26.000000000 -0600
+++ configure	2024-07-02 07:04:21.000000000 -0500
@@ -1862,7 +1862,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -2019,7 +2019,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -2070,7 +2070,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 #ifndef __GNUC__
        choke me
@@ -2123,7 +2123,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -2211,7 +2211,7 @@
 int argc;
 char **argv;
 int
-main ()
+main (void)
 {
 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
@@ -2304,7 +2304,7 @@
 #include <stdlib.h>
 $ac_declaration
 int
-main ()
+main (void)
 {
 exit (42);
   ;
@@ -2340,7 +2340,7 @@
 /* end confdefs.h.  */
 $ac_declaration
 int
-main ()
+main (void)
 {
 exit (42);
   ;
@@ -2808,7 +2808,7 @@
    builtin and then its argument prototype would still apply.  */
 char strerror ();
 int
-main ()
+main (void)
 {
 strerror ();
   ;
@@ -2853,7 +2853,7 @@
    builtin and then its argument prototype would still apply.  */
 char strerror ();
 int
-main ()
+main (void)
 {
 strerror ();
   ;
@@ -3417,7 +3417,7 @@
 #ifdef __cplusplus
 }
 #endif
-main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
 EOF
 
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -3548,7 +3548,7 @@
 #include <float.h>
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -3633,6 +3633,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3646,7 +3647,7 @@
 
 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
-main ()
+main (void)
 {
   int i;
   for (i = 0; i < 256; i++)
@@ -4261,7 +4262,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -4582,7 +4583,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -4674,7 +4675,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -4778,7 +4779,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 int some_variable = 0;
   ;
@@ -4866,7 +4867,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 int some_variable = 0;
   ;
@@ -5936,7 +5937,7 @@
    builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
-main ()
+main (void)
 {
 dlopen ();
   ;
@@ -6012,7 +6013,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != dlopen;
   ;
@@ -6087,7 +6088,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != shl_load;
   ;
@@ -6143,7 +6144,7 @@
    builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
-main ()
+main (void)
 {
 dlopen ();
   ;
@@ -6200,7 +6201,7 @@
    builtin and then its argument prototype would still apply.  */
 char shl_load ();
 int
-main ()
+main (void)
 {
 shl_load ();
   ;
@@ -6324,7 +6325,7 @@
 #endif
 
 fnord() { int i=42;}
-main ()
+int main (void)
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
   int status = $lt_dlunknown;
@@ -6422,7 +6423,7 @@
 #endif
 
 fnord() { int i=42;}
-main ()
+int main (void)
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
   int status = $lt_dlunknown;
@@ -8010,7 +8011,7 @@
 /* end confdefs.h.  */
 #include <X11/Intrinsic.h>
 int
-main ()
+main (void)
 {
 XtMalloc (0)
   ;
@@ -8112,7 +8113,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -8154,7 +8155,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -8221,7 +8222,7 @@
    builtin and then its argument prototype would still apply.  */
 char XOpenDisplay ();
 int
-main ()
+main (void)
 {
 XOpenDisplay ();
   ;
@@ -8268,7 +8269,7 @@
    builtin and then its argument prototype would still apply.  */
 char dnet_ntoa ();
 int
-main ()
+main (void)
 {
 dnet_ntoa ();
   ;
@@ -8327,7 +8328,7 @@
    builtin and then its argument prototype would still apply.  */
 char dnet_ntoa ();
 int
-main ()
+main (void)
 {
 dnet_ntoa ();
   ;
@@ -8417,7 +8418,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != gethostbyname;
   ;
@@ -8472,7 +8473,7 @@
    builtin and then its argument prototype would still apply.  */
 char gethostbyname ();
 int
-main ()
+main (void)
 {
 gethostbyname ();
   ;
@@ -8531,7 +8532,7 @@
    builtin and then its argument prototype would still apply.  */
 char gethostbyname ();
 int
-main ()
+main (void)
 {
 gethostbyname ();
   ;
@@ -8618,7 +8619,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != connect;
   ;
@@ -8673,7 +8674,7 @@
    builtin and then its argument prototype would still apply.  */
 char connect ();
 int
-main ()
+main (void)
 {
 connect ();
   ;
@@ -8753,7 +8754,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != remove;
   ;
@@ -8808,7 +8809,7 @@
    builtin and then its argument prototype would still apply.  */
 char remove ();
 int
-main ()
+main (void)
 {
 remove ();
   ;
@@ -8888,7 +8889,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != shmat;
   ;
@@ -8943,7 +8944,7 @@
    builtin and then its argument prototype would still apply.  */
 char shmat ();
 int
-main ()
+main (void)
 {
 shmat ();
   ;
@@ -9013,7 +9014,7 @@
    builtin and then its argument prototype would still apply.  */
 char IceConnectionNumber ();
 int
-main ()
+main (void)
 {
 IceConnectionNumber ();
   ;
@@ -9219,8 +9220,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+char XpmReadFileToPixmap ();
 int
-main ()
+main (void)
 {
 XpmReadFileToPixmap()
   ;
@@ -9423,7 +9425,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
   int s;
   wait (&s);
@@ -9500,6 +9502,9 @@
 	sys/time.h \
 	utmp.h \
 	utmpx.h \
+	libutil.h \
+	pty.h \
+	util.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -9659,7 +9664,7 @@
 #include <time.h>
 
 int
-main ()
+main (void)
 {
 if ((struct tm *) 0)
 return 0;
@@ -9717,7 +9722,7 @@
 #include <termios.h>
 #endif
 int
-main ()
+main (void)
 {
 int a = ECHO;
   ;
@@ -9776,7 +9781,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-main()
+#include <stdlib.h>
+#include <X11/Xlib.h>
+int main(void)
 {
     exit(0);
     (void) XOpenDisplay("foobar");
@@ -9826,7 +9833,9 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-main()
+#include <stdlib.h>
+#include <X11/Xlib.h>
+int main(void)
 {
     exit(0);
     (void) XOpenDisplay("foobar");
@@ -9876,7 +9885,7 @@
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 int
-main ()
+main (void)
 {
 XPointer dummy;
   ;
@@ -9931,7 +9940,7 @@
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 /* FIXME: Include the comments suggested by Paul. */
 #ifndef __cplusplus
@@ -10089,7 +10098,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((mode_t *) 0)
   return 0;
@@ -10146,7 +10155,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((pid_t *) 0)
   return 0;
@@ -10244,7 +10253,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((char *) 0)
   return 0;
@@ -10299,7 +10308,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
 test_array [0] = 0
@@ -10331,7 +10340,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
 test_array [0] = 0
@@ -10379,7 +10388,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
 test_array [0] = 0
@@ -10411,7 +10420,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
 test_array [0] = 0
@@ -10467,7 +10476,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
 test_array [0] = 0
@@ -10526,7 +10535,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -10605,7 +10614,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((short *) 0)
   return 0;
@@ -10660,7 +10669,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)];
 test_array [0] = 0
@@ -10692,7 +10701,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
 test_array [0] = 0
@@ -10740,7 +10749,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)];
 test_array [0] = 0
@@ -10772,7 +10781,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)];
 test_array [0] = 0
@@ -10828,7 +10837,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
 test_array [0] = 0
@@ -10887,7 +10896,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -10966,7 +10975,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((int *) 0)
   return 0;
@@ -11021,7 +11030,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
 test_array [0] = 0
@@ -11053,7 +11062,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
 test_array [0] = 0
@@ -11101,7 +11110,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
 test_array [0] = 0
@@ -11133,7 +11142,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
 test_array [0] = 0
@@ -11189,7 +11198,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
 test_array [0] = 0
@@ -11248,7 +11257,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -11327,7 +11336,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((long *) 0)
   return 0;
@@ -11382,7 +11391,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
 test_array [0] = 0
@@ -11414,7 +11423,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
 test_array [0] = 0
@@ -11462,7 +11471,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
 test_array [0] = 0
@@ -11494,7 +11503,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
 test_array [0] = 0
@@ -11550,7 +11559,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
 test_array [0] = 0
@@ -11609,7 +11618,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -11688,7 +11697,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((long long *) 0)
   return 0;
@@ -11743,7 +11752,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
 test_array [0] = 0
@@ -11775,7 +11784,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
 test_array [0] = 0
@@ -11823,7 +11832,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
 test_array [0] = 0
@@ -11855,7 +11864,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
 test_array [0] = 0
@@ -11911,7 +11920,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
 test_array [0] = 0
@@ -11970,7 +11979,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -12049,7 +12058,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 if ((int * *) 0)
   return 0;
@@ -12104,7 +12113,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= 0)];
 test_array [0] = 0
@@ -12136,7 +12145,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)];
 test_array [0] = 0
@@ -12184,7 +12193,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int *))) < 0)];
 test_array [0] = 0
@@ -12216,7 +12225,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= $ac_mid)];
 test_array [0] = 0
@@ -12272,7 +12281,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)];
 test_array [0] = 0
@@ -12331,7 +12340,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -12412,7 +12421,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 int16_t dummy;
   ;
@@ -12486,7 +12495,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 u_int16_t dummy;
   ;
@@ -12560,7 +12569,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 int32_t dummy;
   ;
@@ -12634,7 +12643,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 u_int32_t dummy;
   ;
@@ -12708,7 +12717,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 int64_t dummy;
   ;
@@ -12782,7 +12791,7 @@
 /* end confdefs.h.  */
 #include <sys/types.h>
 int
-main ()
+main (void)
 {
 u_int64_t dummy;
   ;
@@ -12886,7 +12895,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 int i;
   ;
@@ -13010,7 +13019,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 return f != $ac_func;
   ;
@@ -13195,7 +13204,7 @@
 #include <sys/types.h>
 #include <utmp.h>
 int
-main ()
+main (void)
 {
 struct utmp ut;
   ;
@@ -13249,7 +13258,7 @@
 #include <sys/types.h>
 #include <utmp.h>
 int
-main ()
+main (void)
 {
 struct utmp ut; ut.ut_host;
   ;
@@ -13302,7 +13311,7 @@
 #include <sys/types.h>
 #include <utmp.h>
 int
-main ()
+main (void)
 {
 struct utmp ut; ut.ut_pid;
   ;
@@ -13489,7 +13498,7 @@
 #include <sys/types.h>
 #include <utmpx.h>
 int
-main ()
+main (void)
 {
 struct utmpx ut;
   ;
@@ -13543,7 +13552,7 @@
 #include <sys/types.h>
 #include <utmpx.h>
 int
-main ()
+main (void)
 {
 struct utmpx utx; utx.ut_host;
   ;
@@ -13604,7 +13613,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 struct lastlog ll;
   ;
@@ -13661,7 +13670,7 @@
 #endif
 
 int
-main ()
+main (void)
 {
 struct lastlogx ll;
   ;
@@ -13720,7 +13729,8 @@
 #include <sys/types.h>
 #include <utmp.h>
 #include <errno.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **u, *utmplist[] = {
     "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL };
@@ -13801,7 +13811,8 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **u, *p, *utmplist[] = {
 #ifdef UTMPX_FILE
@@ -13886,7 +13897,8 @@
 #include <utmp.h>
 #endif
 #include <errno.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **w, *wtmplist[] = {
     "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
@@ -13963,7 +13975,8 @@
 #include <utmpx.h>
 #endif
 #include <errno.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **w, *wtmplist[] = {
     "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
@@ -14046,7 +14059,8 @@
 #include <lastlog.h>
 #endif
 #include <errno.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **w, *lastloglist[] = { "/var/log/lastlog", NULL };
     FILE *a, *f=fopen("conftestval", "w");
@@ -14129,7 +14143,8 @@
 #include <utmpx.h>
 #endif
 #include <errno.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
     char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
     FILE *a, *f=fopen("conftestval", "w");
@@ -14234,7 +14249,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
-main() {
+#include <stdlib.h>
+int main(void) {
 char *p;
 if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
 exit (XSupportsLocale() ? 0 : 1);
@@ -14289,7 +14305,7 @@
 #define X_LOCALE 1
 #include <X11/Xlocale.h>
 int
-main ()
+main (void)
 {
 setlocale(LC_CTYPE, "");
   ;
@@ -14343,7 +14359,7 @@
 /* end confdefs.h.  */
 #include <locale.h>
 int
-main ()
+main (void)
 {
 setlocale(LC_CTYPE, "");
   ;
@@ -14395,7 +14411,7 @@
 /* end confdefs.h.  */
 #include <langinfo.h>
 int
-main ()
+main (void)
 {
 nl_langinfo(CODESET);
   ;
@@ -14450,7 +14466,7 @@
 # include <stdlib.h>
 #endif
 int
-main ()
+main (void)
 {
 (void)getpt();
   ;
@@ -14635,7 +14651,7 @@
    builtin and then its argument prototype would still apply.  */
 char setlocale ();
 int
-main ()
+main (void)
 {
 setlocale ();
   ;
--- src/ptytty.c.orig	2002-09-19 02:40:39.000000000 -0500
+++ src/ptytty.c	2024-07-02 07:07:11.000000000 -0500
@@ -49,6 +49,18 @@
 #if defined(PTYS_ARE_PTMX) && !defined(__CYGWIN32__)
 # include <sys/stropts.h>      /* for I_PUSH */
 #endif
+#ifdef HAVE_LIBUTIL_H
+/* FreeBSD openpty */
+# include <libutil.h>
+#endif
+#ifdef HAVE_PTY_H
+/* Linux openpty */
+# include <pty.h>
+#endif
+#ifdef HAVE_UTIL_H
+/* macOS openpty */
+# include <util.h>
+#endif
 
 
 #ifdef DEBUG_TTY
--- src/screen.c.orig	2003-03-23 10:56:06.000000000 -0600
+++ src/screen.c	2024-07-02 07:31:20.000000000 -0500
@@ -1942,8 +1942,8 @@
     text_t         *dtp, *stp;	/* drawn-text-pointer, screen-text-pointer   */
     char           *buffer;	/* local copy of r->h->buffer                */
     struct rxvt_hidden *h = r->h;
-    int             (*draw_string) () = XDrawString;
-    int             (*draw_image_string) () = XDrawImageString;
+    int             (*draw_string) (Display*, Drawable, GC, int, int, _Xconst char*, int) = XDrawString;
+    int             (*draw_image_string) (Display*, Drawable, GC, int, int, _Xconst char*, int) = XDrawImageString;
 
     if (refresh_type == NO_REFRESH || !r->TermWin.mapped)
 	return;
