home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / id-utils-3.2-src.tgz / tar.out / fsf / id-utils / lib / xalloca.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  1KB  |  48 lines

  1. /* xalloca.h -- alloca declarations wrapper
  2.    Copyright (C) 1996 Free Software Foundation, Inc.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18.  
  19. #ifndef _xalloca_h_
  20. #define _xalloca_h_ 1
  21.  
  22. #if HAVE_CONFIG_H
  23. # include <config.h>
  24. #endif
  25.  
  26. #ifndef alloca
  27. # ifdef __GNUC__
  28. #  define alloca __builtin_alloca
  29. #  define HAVE_ALLOCA 1
  30. # else
  31. #  if defined HAVE_ALLOCA_H || defined _LIBC
  32. #   include <alloca.h>
  33. #  else
  34. #   ifdef _AIX
  35.  #pragma alloca
  36. #   else
  37. #    ifndef alloca
  38. char *alloca ();
  39. #    endif
  40. #   endif
  41. #  endif
  42. # endif
  43. #endif
  44.  
  45. #define ALLOCA(t, n) ((t *) alloca (sizeof (t) * (n)))
  46.  
  47. #endif /* _xalloca_h_ */
  48.