[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pidgin-commits
Subject:    /pidgin/main: 312be70f9de6: Remove AC_HEADER_STDC and related C8...
From:       Elliott Sales de Andrade <qulogic () pidgin ! im>
Date:       2016-09-21 17:34:22
Message-ID: hg.312be70f9de6.1474479262.-874508059 () rock ! pidgin ! im
[Download RAW message or body]

Changeset: 312be70f9de6b001f3f55f83e7d1483ae273be0b
Author:	 Elliott Sales de Andrade <qulogic@pidgin.im>
Date:	 2016-08-28 20:43 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/312be70f9de6

Description:

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.

diffstat:

 config.h.mingw                                 |  18 ----------------
 configure.ac                                   |   4 +--
 finch/getopt.c                                 |   2 -
 libpurple/protocols/zephyr/Zinternal.c         |  14 ------------
 libpurple/protocols/zephyr/sysdep.h            |  29 +------------------------
 libpurple/util.c                               |   2 -
 pidgin/getopt.c                                |   2 -
 pidgin/libpidgin.c                             |  28 +------------------------
 pidgin/plugins/musicmessaging/musicmessaging.c |   5 ----
 9 files changed, 4 insertions(+), 100 deletions(-)

diffs (truncated from 372 to 300 lines):

diff --git a/config.h.mingw b/config.h.mingw
--- a/config.h.mingw
+++ b/config.h.mingw
@@ -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 */
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,6 @@ case "$host" in
 		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(PIDGIN_LIBS)
 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, ,[
diff --git a/finch/getopt.c b/finch/getopt.c
--- a/finch/getopt.c
+++ b/finch/getopt.c
@@ -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
diff --git a/libpurple/protocols/zephyr/Zinternal.c b/libpurple/protocols/zephyr/Zinternal.c
--- a/libpurple/protocols/zephyr/Zinternal.c
+++ b/libpurple/protocols/zephyr/Zinternal.c
@@ -931,7 +931,6 @@ const char *const ZNoticeKinds[] = {
 #ifdef Z_DEBUG
 
 #undef Z_debug
-#ifdef HAVE_STDARG_H
 void Z_debug (const char *format, ...)
 {
     va_list pvar;
@@ -941,19 +940,6 @@ void Z_debug (const char *format, ...)
     (*__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;
diff --git a/libpurple/protocols/zephyr/sysdep.h b/libpurple/protocols/zephyr/sysdep.h
--- a/libpurple/protocols/zephyr/sysdep.h
+++ b/libpurple/protocols/zephyr/sysdep.h
@@ -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 @@ extern char *sys_errlist[];
 #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
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -4634,7 +4634,6 @@ gchar * purple_escape_js(const gchar *st
 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 @@ void purple_restore_default_signal_handl
 	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 */
 }
 
diff --git a/pidgin/getopt.c b/pidgin/getopt.c
--- a/pidgin/getopt.c
+++ b/pidgin/getopt.c
@@ -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
diff --git a/pidgin/libpidgin.c b/pidgin/libpidgin.c
--- a/pidgin/libpidgin.c
+++ b/pidgin/libpidgin.c
@@ -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 @@ static const int ignore_sig_list[] = {
 	SIGPIPE,
 	-1
 };
-#endif
 
 static void
 dologin_named(const char *name)
@@ -126,7 +121,6 @@ dologin_named(const char *name)
 	}
 }
 
-#ifdef HAVE_SIGNAL_H
 static char *segfault_message;
 
 static int signal_sockets[2];
@@ -195,7 +189,6 @@ mainloop_sighandler(GIOChannel *source, 
 
 	return TRUE;
 }
-#endif
 
 static int
 ui_main(void)
@@ -434,7 +427,6 @@ int pidgin_start(int argc, char *argv[])
 	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 @@ int pidgin_start(int argc, char *argv[])
 #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 @@ int pidgin_start(int argc, char *argv[])
 	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 @@ int pidgin_start(int argc, char *argv[])
 		snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals");
 		perror(errmsg);
 	}
-#endif
 
 	/* scan command-line options */
 	opterr = 1;
@@ -640,9 +628,7 @@ int pidgin_start(int argc, char *argv[])
 		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 @@ int pidgin_start(int argc, char *argv[])
 	/* 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 */

_______________________________________________
Commits mailing list
Commits@pidgin.im
https://pidgin.im/cgi-bin/mailman/listinfo/commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic