Remove AC_HEADER_STDC and related C89 tests.

Sun, 28 Aug 2016 20:43:17 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 28 Aug 2016 20:43:17 -0400
changeset 38047
312be70f9de6
parent 38013
c21651e4f58e
child 38048
a3aaf7cef832

Remove AC_HEADER_STDC and related C89 tests.

AC_HEADER_STDC is obsolescent because all current systems have
conforming header files. As we also claim to depend on C89, there's
no need to check for any headers defined in that standard.

config.h.mingw file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
finch/getopt.c file | annotate | diff | comparison | revisions
libpurple/protocols/zephyr/Zinternal.c file | annotate | diff | comparison | revisions
libpurple/protocols/zephyr/sysdep.h file | annotate | diff | comparison | revisions
libpurple/util.c file | annotate | diff | comparison | revisions
pidgin/getopt.c file | annotate | diff | comparison | revisions
pidgin/libpidgin.c file | annotate | diff | comparison | revisions
pidgin/plugins/musicmessaging/musicmessaging.c file | annotate | diff | comparison | revisions
--- a/config.h.mingw	Tue Sep 06 14:45:30 2016 -0500
+++ b/config.h.mingw	Sun Aug 28 20:43:17 2016 -0400
@@ -150,9 +150,6 @@
 /* Define to 1 if you have the `socket' library (-lsocket). */
 /* #undef HAVE_LIBSOCKET */
 
-/* Define to 1 if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
 /* Define to 1 if you have the `lrand48' function. */
 /* #define HAVE_LRAND48 1 */
 
@@ -222,9 +219,6 @@
 /* Define to 1 if you have the <sgtty.h> header file. */
 /* #define HAVE_SGTTY_H 1 */
 
-/* Define to 1 if you have the <signal.h> header file. */
-/* #define HAVE_SIGNAL_H 1 */
-
 /* Define if we have silcmime.h */
 #define HAVE_SILCMIME_H 1
 
@@ -240,15 +234,9 @@
 /* Define to 1 if you have the <ssl.h> header file. */
 /* #undef HAVE_SSL_H */
 
-/* Define to 1 if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
 
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
 /* Define to 1 if you have the `strchr' function. */
 #define HAVE_STRCHR 1
 
@@ -264,9 +252,6 @@
 /* Define to 1 if you have the <strings.h> header file. */
 #define HAVE_STRINGS_H 1
 
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
 /* Define to 1 if you have the `strstr' function. */
 #define HAVE_STRSTR 1
 
@@ -412,9 +397,6 @@
 #define STATIC_PROTO_INIT static void static_proto_init(void) {  }
 #endif
 
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
 /* Use GStreamer for playing sounds */
 /* It's defined in global.mak. */
 /* #undef USE_GSTREAMER */
--- a/configure.ac	Tue Sep 06 14:45:30 2016 -0500
+++ b/configure.ac	Sun Aug 28 20:43:17 2016 -0400
@@ -149,7 +149,6 @@
 		is_win32="no"
 		is_not_win32="yes"
 		PLUGIN_LDFLAGS="-avoid-version"
-		AC_CHECK_HEADERS(signal.h)
 		;;
 esac
 AM_CONDITIONAL(IS_WIN32, test "x$is_win32" = "xyes")
@@ -164,9 +163,8 @@
 AC_SUBST(FINCH_LIBS)
 
 dnl Checks for header files.
-AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h unistd.h locale.h stdint.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h stdint.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_SIZEOF(time_t, ,[
--- a/finch/getopt.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/finch/getopt.c	Sun Aug 28 20:43:17 2016 -0400
@@ -32,9 +32,7 @@
 #endif
 
 /* Alver says we need this for IRIX. */
-#if HAVE_STRING_H
 #include "string.h"
-#endif
 
 #ifdef __GNUC__
 #define alloca __builtin_alloca
--- a/libpurple/protocols/zephyr/Zinternal.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/libpurple/protocols/zephyr/Zinternal.c	Sun Aug 28 20:43:17 2016 -0400
@@ -931,7 +931,6 @@
 #ifdef Z_DEBUG
 
 #undef Z_debug
-#ifdef HAVE_STDARG_H
 void Z_debug (const char *format, ...)
 {
     va_list pvar;
@@ -941,19 +940,6 @@
     (*__Z_debug_print) (format, pvar, __Z_debug_print_closure);
     va_end (pvar);
 }
-#else /* stdarg */
-void Z_debug (va_alist) va_dcl
-{
-    va_list pvar;
-    char *format;
-    if (!__Z_debug_print)
-      return;
-    va_start (pvar);
-    format = va_arg (pvar, char *);
-    (*__Z_debug_print) (format, pvar, __Z_debug_print_closure);
-    va_end (pvar);
-}
-#endif
 
 void Z_debug_stderr (format, args, closure)
      const char *format;
--- a/libpurple/protocols/zephyr/sysdep.h	Tue Sep 06 14:45:30 2016 -0500
+++ b/libpurple/protocols/zephyr/sysdep.h	Sun Aug 28 20:43:17 2016 -0400
@@ -26,17 +26,7 @@
 #include <sys/param.h>
 #include <sys/time.h>
 
-#if defined(STDC_HEADERS) || defined(HAVE_STDLIB_H)
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-#  include <malloc.h>
-# else
-char *malloc(), *realloc(void);
-# endif
-char *getenv(), *strerror(), *ctime(), *strcpy(void);
-time_t time(void);
-#endif
+#include <stdlib.h>
 
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
@@ -44,22 +34,7 @@
 #endif
 
 /* Strings. */
-#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
-# include <string.h>
-#else
-# ifndef HAVE_STRCHR
-#  define strchr index
-#  define strrchr rindex
-# endif
-char *strchr(), *strrchr(void);
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-#  define memcmp bcmp
-# endif
-# ifndef HAVE_MEMMOVE
-#  define memmove(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
+#include <string.h>
 
 /* Exit status handling and wait(). */
 #ifdef HAVE_SYS_WAIT_H
--- a/libpurple/util.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/libpurple/util.c	Sun Aug 28 20:43:17 2016 -0400
@@ -4634,7 +4634,6 @@
 void purple_restore_default_signal_handlers(void)
 {
 #ifndef _WIN32
-#ifdef HAVE_SIGNAL_H
 	signal(SIGHUP, SIG_DFL);	/* 1: terminal line hangup */
 	signal(SIGINT, SIG_DFL);	/* 2: interrupt program */
 	signal(SIGQUIT, SIG_DFL);	/* 3: quit program */
@@ -4660,7 +4659,6 @@
 	signal(SIGCHLD, SIG_DFL);	/* 20: child status has changed */
 	signal(SIGXCPU, SIG_DFL);	/* 24: exceeded CPU time limit */
 	signal(SIGXFSZ, SIG_DFL);	/* 25: exceeded file size limit */
-#endif /* HAVE_SIGNAL_H */
 #endif /* !_WIN32 */
 }
 
--- a/pidgin/getopt.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/pidgin/getopt.c	Sun Aug 28 20:43:17 2016 -0400
@@ -32,9 +32,7 @@
 #endif
 
 /* Alver says we need this for IRIX. */
-#if HAVE_STRING_H
 #include "string.h"
-#endif
 
 #ifdef __GNUC__
 #define alloca __builtin_alloca
--- a/pidgin/libpidgin.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/pidgin/libpidgin.c	Sun Aug 28 20:43:17 2016 -0400
@@ -70,15 +70,11 @@
 #include "pidginstock.h"
 #include "gtkwhiteboard.h"
 
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 
 #include <getopt.h>
 
 
-#ifdef HAVE_SIGNAL_H
-
 /*
  * Lists of signals we wish to catch and those we wish to ignore.
  * Each list terminated with -1
@@ -96,7 +92,6 @@
 	SIGPIPE,
 	-1
 };
-#endif
 
 static void
 dologin_named(const char *name)
@@ -126,7 +121,6 @@
 	}
 }
 
-#ifdef HAVE_SIGNAL_H
 static char *segfault_message;
 
 static int signal_sockets[2];
@@ -195,7 +189,6 @@
 
 	return TRUE;
 }
-#endif
 
 static int
 ui_main(void)
@@ -434,7 +427,6 @@
 	GtkCssProvider *provider;
 	GdkScreen *screen;
 	GList *accounts;
-#ifdef HAVE_SIGNAL_H
 	int sig_indx;	/* for setting up signal catching */
 	sigset_t sigset;
 	char errmsg[BUFSIZ];
@@ -445,7 +437,6 @@
 #ifndef DEBUG
 	char *segfault_message_tmp;
 #endif /* DEBUG */
-#endif /* HAVE_SIGNAL_N */
 	int opt;
 	gboolean gui_check;
 	gboolean debug_enabled, debug_colored;
@@ -485,8 +476,6 @@
 	setlocale(LC_ALL, "");
 #endif
 
-#ifdef HAVE_SIGNAL_H
-
 #ifndef DEBUG
 		/* We translate this here in case the crash breaks gettext. */
 		segfault_message_tmp = g_strdup_printf(_(
@@ -587,7 +576,6 @@
 		snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals");
 		perror(errmsg);
 	}
-#endif
 
 	/* scan command-line options */
 	opterr = 1;
@@ -640,9 +628,7 @@
 		case '?':	/* show terse help */
 		default:
 			show_usage(argv[0], TRUE);
-#ifdef HAVE_SIGNAL_H
 			g_free(segfault_message);
-#endif
 			return 0;
 			break;
 		}
@@ -651,18 +637,14 @@
 	/* show help message */
 	if (opt_help) {
 		show_usage(argv[0], FALSE);
-#ifdef HAVE_SIGNAL_H
 		g_free(segfault_message);
-#endif
 		return 0;
 	}
 	/* show version message */
 	if (opt_version) {
 		printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION,
 		                                 purple_core_get_version());
-#ifdef HAVE_SIGNAL_H
 		g_free(segfault_message);
-#endif
 		return 0;
 	}
 
@@ -697,9 +679,7 @@
 		printf("%s %s\n", PIDGIN_NAME, DISPLAY_VERSION);
 
 		g_warning("cannot open display: %s", display ? display : "unset");
-#ifdef HAVE_SIGNAL_H
 		g_free(segfault_message);
-#endif
 
 		return 1;
 	}
@@ -733,9 +713,7 @@
 		fprintf(stderr,
 				"Initialization of the libpurple core failed. Dumping core.\n"
 				"Please report this!\n");
-#ifdef HAVE_SIGNAL_H
 		g_free(segfault_message);
-#endif
 		abort();
 	}
 
@@ -761,9 +739,7 @@
 		gdk_notify_startup_complete();
 		purple_core_quit();
 		g_printerr(_("Exiting because another libpurple client is already running.\n"));
-#ifdef HAVE_SIGNAL_H
 		g_free(segfault_message);
-#endif
 		return 0;
 	}
 
@@ -848,12 +824,10 @@
 
 	gtk_main();
 
-#ifdef HAVE_SIGNAL_H
 	g_free(segfault_message);
 	g_source_remove(signal_channel_watcher);
 	close(signal_sockets[0]);
 	close(signal_sockets[1]);
-#endif
 
 #ifdef _WIN32
 	winpidgin_cleanup();
--- a/pidgin/plugins/musicmessaging/musicmessaging.c	Tue Sep 06 14:45:30 2016 -0500
+++ b/pidgin/plugins/musicmessaging/musicmessaging.c	Sun Aug 28 20:43:17 2016 -0400
@@ -520,16 +520,11 @@
 
 static void kill_editor (MMConversation *mmconv)
 {
-#ifdef HAVE_SIGNAL_H
 	if (mmconv->pid)
 	{
 		kill(mmconv->pid, SIGINT);
 		mmconv->pid = 0;
 	}
-#else
-	purple_debug_warning("musicmessaging",
-		"kill() is not supported on this platform");
-#endif
 }
 
 static void init_conversation (PurpleConversation *conv)

mercurial