Adopt use of gnulib for portability.
[pspp-builds.git] / src / alloc.h
index 50e7ab1f10bb6c418811051892f506202599c505..c1148413f3bf7e66b372be33aa587209d9a212dd 100644 (file)
 
    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. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 #if !alloc_h
 #define alloc_h 1
 
 #include <stddef.h>
 
-/* Functions. */
-void *xmalloc (size_t size);
-void *xcalloc (size_t size);
-void *xrealloc (void *ptr, size_t size);
-char *xstrdup (const char *s);
+/* malloc() wrapper functions. */
+#include "xalloc.h"
+void out_of_memory (void) NO_RETURN;
+\f
+/* alloca() wrapper functions. */
+#if defined (HAVE_ALLOCA) || defined (C_ALLOCA)
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#define local_alloc(X) alloca (X)
+#define local_free(P) ((void) 0)
+#else
+#define local_alloc(X) xmalloc (X)
+#define local_free(P) free (P)
+#endif
 
 #endif /* alloc.h */