aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ircd.h2
-rw-r--r--include/ircd_defs.h19
-rw-r--r--include/ircd_getopt.h2
-rw-r--r--include/restart.h4
-rw-r--r--include/stdinc.h120
5 files changed, 22 insertions, 125 deletions
diff --git a/include/ircd.h b/include/ircd.h
index 28df4d5b..9edc7b68 100644
--- a/include/ircd.h
+++ b/include/ircd.h
@@ -103,6 +103,6 @@ extern bool ircd_ssl_ok;
extern bool ircd_zlib_ok;
extern int maxconnections;
-void ircd_shutdown(const char *reason) __attribute__((noreturn));
+void ircd_shutdown(const char *reason) __noreturn;
#endif
diff --git a/include/ircd_defs.h b/include/ircd_defs.h
index 98b5cea4..9ca5b62c 100644
--- a/include/ircd_defs.h
+++ b/include/ircd_defs.h
@@ -37,25 +37,6 @@
#include "defaults.h"
-/* For those unfamiliar with GNU format attributes, a is the 1 based
- * argument number of the format string, and b is the 1 based argument
- * number of the variadic ... */
-#ifdef __GNUC__
-#define AFP(a,b) __attribute__((format (printf, a, b)))
-#else
-#define AFP(a,b)
-#endif
-
-/*
- * This ensures that __attribute__((deprecated)) is not used in for example
- * sun CC, since it's a GNU-specific extension. -nenolod
- */
-#ifdef __GNUC__
-#define IRC_DEPRECATED __attribute__((deprecated))
-#else
-#define IRC_DEPRECATED
-#endif
-
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
diff --git a/include/ircd_getopt.h b/include/ircd_getopt.h
index bd41cbe8..16fdf7dd 100644
--- a/include/ircd_getopt.h
+++ b/include/ircd_getopt.h
@@ -37,7 +37,7 @@ struct lgetopt
extern struct lgetopt myopts[];
-void usage(const char *) __attribute__((noreturn));
+void usage(const char *) __noreturn;
void parseargs(int *, char * const **, struct lgetopt *);
#endif /* __GETOPT_H_INCLUDED__ */
diff --git a/include/restart.h b/include/restart.h
index 770b246f..ca42fe5a 100644
--- a/include/restart.h
+++ b/include/restart.h
@@ -25,7 +25,7 @@
#ifndef INCLUDED_restart_h
#define INCLUDED_restart_h
-void restart(const char *) __attribute__((noreturn));
-void server_reboot(void) __attribute__((noreturn));
+void restart(const char *) __noreturn;
+void server_reboot(void) __noreturn;
#endif
diff --git a/include/stdinc.h b/include/stdinc.h
index e6952f6d..13c7f885 100644
--- a/include/stdinc.h
+++ b/include/stdinc.h
@@ -21,122 +21,38 @@
*
*/
+#ifndef INCLUDED_stdinc_h
+#define INCLUDED_stdinc_h 1
+
#include "rb_lib.h"
#include "ircd_defs.h" /* Needed for some reasons here -- dwr */
-/* AIX requires this to be the first thing in the file. */
-#ifdef __GNUC__
-#undef alloca
-#define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
-
-
-#ifdef HAVE_STDLIB_H
+#include <stdbool.h>
#include <stdlib.h>
-#endif
-#ifdef STRING_WITH_STRINGS
-# include <string.h>
-# include <strings.h>
-#else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
-# endif
-#endif
-
-#include <stddef.h>
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-# ifndef HAVE__BOOL
-# ifdef __cplusplus
-typedef bool _Bool;
-# else
-# define _Bool signed char
-# endif
-# endif
-# define bool _Bool
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
-#endif
-
-
-#include <stdint.h>
-#include <assert.h>
-#include <stdio.h>
-#include <time.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <signal.h>
#include <dirent.h>
-#include <ctype.h>
-
-#include <limits.h>
+#include <errno.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
#include <unistd.h>
-#include <sys/time.h>
-#include <sys/types.h>
+
#include <sys/file.h>
#include <sys/resource.h>
-
#include <sys/stat.h>
+#include <sys/time.h>
#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
+# include <sys/param.h>
#endif
-#include <errno.h>
-#include <sys/uio.h>
-
-#if defined(__INTEL_COMPILER) || defined(__GNUC__)
-# ifdef __unused
-# undef __unused
-# endif
-# ifdef __printf
-# undef __printf
-# endif
-# ifdef __noreturn
-# undef __noreturn
-# endif
-
-# define __unused __attribute__((__unused__))
-# define __printf(x) __attribute__((__format__ (__printf__, x, x + 1)))
-# define __noreturn __attribute__((__noreturn__))
+#if defined(strdupa)
+# define LOCAL_COPY(s) strdupa(s)
+#elif defined(__GNUC__) || defined(__INTEL_COMPILER)
+# define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
#else
-# define __unused
-# define __printf
-# define __noreturn
+# define LOCAL_COPY(s) strcpy(alloca(strlen(s) + 1), s) /* XXX Is that allowed? */
#endif
-
-
-#ifdef strdupa
-#define LOCAL_COPY(s) strdupa(s)
-#else
-#if defined(__INTEL_COMPILER) || defined(__GNUC__)
-# define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
-#else
-# define LOCAL_COPY(s) strcpy(alloca(strlen(s) + 1), s) /* XXX Is that allowed? */
-#endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */
-#endif /* strdupa */
+#endif /* !INCLUDED_stdinc_h */