27 |
#ifndef M4_SYSTEM_H |
#ifndef M4_SYSTEM_H |
28 |
#define M4_SYSTEM_H 1 |
#define M4_SYSTEM_H 1 |
29 |
|
|
30 |
/* I have yet to see a system that doesn't have these... */ |
#include <stdlib.h> |
31 |
#include <stdio.h> |
#include <stdio.h> |
32 |
#include <sys/types.h> |
#include <sys/types.h> |
33 |
@INCLUDE_ERROR_H@ |
@INCLUDE_ERROR_H@ |
34 |
@INCLUDE_OBSTACK_H@ |
@INCLUDE_OBSTACK_H@ |
35 |
@INCLUDE_STDBOOL_H@ |
@INCLUDE_STDBOOL_H@ |
36 |
|
#include <m4/xalloc.h> |
37 |
|
|
38 |
/* This is okay in an installed file, because it will not change the |
/* This is okay in an installed file, because it will not change the |
39 |
behaviour of the including program whether ENABLE_NLS is defined |
behaviour of the including program whether ENABLE_NLS is defined |
152 |
# define EXIT_FAILURE 1 |
# define EXIT_FAILURE 1 |
153 |
#endif |
#endif |
154 |
|
|
|
|
|
155 |
|
|
156 |
/* Memory allocation. */ |
/* FIXME: macros to ease transition to gnulib xalloc.h API */ |
157 |
#define XCALLOC(type, num) ((type *) xcalloc ((num), sizeof(type))) |
#undef XFREE |
158 |
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
#define XFREE(Var) ((Var) = xfree (Var)) |
|
#define XREALLOC(type, p, num) ((type *) xrealloc ((p), (num) * sizeof(type))) |
|
|
#define XFREE(p) ((p) = xfree (p)) |
|
|
|
|
|
extern void *xcalloc (size_t n, size_t s); |
|
|
extern void *xmalloc (size_t n); |
|
|
extern void *xrealloc (void *p, size_t n); |
|
|
extern void *xfree (void *stale); |
|
159 |
|
|
160 |
extern char *xstrdup (const char *string); |
extern void *xfree (void *stale); |
161 |
extern char *xstrzdup (const char *string, size_t len); |
extern char *xstrzdup (const char *string, size_t len); |
162 |
|
|
163 |
END_C_DECLS |
END_C_DECLS |