Description: Fix implicit function declarations
Bug-Debian: https://bugs.debian.org/1066490
Origin: fedora, https://src.fedoraproject.org/rpms/motif/c/5e2c9f6f8b9516563500c6ea771ec2b852692b61
Origin: other, https://bugs.debian.org/1066490#10
Author: Florian Weimer <fweimer@redhat.com>
Author: Samuel Thibault <sthibault@debian.org>
Last-Update: 2024-09-01

--- a/lib/Xm/XpmI.h
+++ b/lib/Xm/XpmI.h
@@ -129,9 +129,9 @@
 extern FILE *popen();
 #endif
 
-#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE)
 #include <string.h>
 
+#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE)
 #ifndef index
 #define index strchr
 #endif
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -23,9 +23,9 @@
 Boolean brc;
 brc=XtToolkitThreadInitialize();
 if (True==brc)
-  exit(0);
+  return 0;
 else
-  exit(1);
+  return 1;
 }
 ],
 lt_cv_xthreads=yes,
@@ -46,18 +46,6 @@
 fi
 ])
 
-dnl This test is not very reliable probably ...
-AC_DEFUN([AM_FUNC_VOID_SPRINTF],
-[AC_CACHE_CHECK(whether sprintf returns void, ac_cv_func_void_sprintf,
-[AC_TRY_RUN([#include <stdio.h>
-int sprintf(); main() { exit(sprintf(".")); }],
-  ac_cv_func_void_sprintf=no, ac_cv_func_void_sprintf=yes, ac_cv_func_void_sprintf=yes)])
-if test $ac_cv_func_void_sprintf = no; then
-  AC_DEFINE(VOID_SPRINTF,1,
-  [Define if sprintf doesn't return the number of chars written])
-fi
-])
-
 dnl This tests whether weak aliases are supported.
 AC_DEFUN([WEAK_ALIAS_SUPPORT],
 [AC_CACHE_CHECK(whether weak aliases are supported, ac_cv_weak_alias_support,
--- a/configure.ac
+++ b/configure.ac
@@ -115,7 +115,6 @@
 AC_FUNC_STRFTIME
 AC_FUNC_FORK([])
 AC_FUNC_VPRINTF
-AM_FUNC_VOID_SPRINTF
 AC_CHECK_FUNCS(wcslen wcscpy wcsncpy wcschr wcscat wcsncat getcwd gettimeofday mkdir re_comp regcmp select strcspn strerror strstr strtod strtol uname)
 AC_CHECK_FUNCS(strdup,,AC_DEFINE(NEED_STRDUP, 1, no strdup))
 AC_CHECK_FUNCS(strcasecmp,,AC_DEFINE(NEED_STRCASECMP, 1, no strcasecmp))
--- a/demos/unsupported/xmform/xmform.c
+++ b/demos/unsupported/xmform/xmform.c
@@ -50,6 +50,7 @@
 xmform*bottomShadowColor:        black
 ***-------------------------------------------------------------------*/
 
+#include <stdlib.h>
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/PushB.h>
