/* * ircd-ratbox: A slightly useful ircd. * stdinc.h: Pull in all of the necessary system headers * * Copyright (C) 2002 Aaron Sethman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */ #include #include "defaults.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 # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif #ifdef HAVE_ERRNO_H #else extern int errno; #endif #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__)) #else # define __unused # define __printf # define __noreturn #endif #ifdef strdupa #define LOCAL_COPY(s) strdupa(s) #else #if defined(__INTEL_COMPILER) || defined(__GNUC__) # define LOCAL_COPY(s) __extension__({ char *_s = (char *)alloca(strlen(s) + 1); strcpy(_s, s); _s; }) #else # define LOCAL_COPY(s) strcpy((char *)alloca(strlen(s) + 1), s) #endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */ #endif /* strdupa */