#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#if defined(__FreeBSD__)
-#include <stdlib.h>
-#elif defined(_WIN32)
+#ifdef _WIN32
#include <malloc.h>
-#else
+#endif
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include "lc_parser_t.h"
#include "hashptr.h"
#include "lc_printf.h"
+#include "xmalloc.h"
#define ERR_STRING "In argument \"%s\": "
lc_opt_entry_t *ent = lc_opt_find_grp(parent, name, NULL);
if(!ent) {
- ent = obstack_alloc(&obst, sizeof(*ent));
+ ent = OALLOC(&obst, lc_opt_entry_t);
init_entry(ent, parent, name, "");
init_grp(ent, NULL);
}
lc_opt_entry_t *ent = lc_opt_find_opt(parent, name, NULL);
if(!ent) {
- res = obstack_alloc(&obst, sizeof(*ent));
+ res = OALLOC(&obst, lc_opt_entry_t);
init_entry(res, parent, name, desc);
init_opt(res, type, value, length, cb, dump, dump_vals, err);
} else