X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flibcore%2Flc_opts.c;h=85b7dcce7aafa5029581f36f37b698647c2baf92;hb=b1bf2c39dbf3895ea8c69550adb453ee907f5278;hp=f9b84b7b066e048360f0042fc055048fd9f2afb8;hpb=04906225f6fe1bc22f73b5d6a98eb9c0992a9b54;p=libfirm diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c index f9b84b7b0..85b7dcce7 100644 --- a/ir/libcore/lc_opts.c +++ b/ir/libcore/lc_opts.c @@ -20,14 +20,14 @@ #include #include +#include #include #include -#if defined(__FreeBSD__) -#include -#elif defined(_WIN32) +#ifdef _WIN32 #include -#else +#endif +#ifdef HAVE_ALLOCA_H #include #endif @@ -52,6 +52,7 @@ #include "lc_parser_t.h" #include "hashptr.h" #include "lc_printf.h" +#include "xmalloc.h" #define ERR_STRING "In argument \"%s\": " @@ -221,7 +222,7 @@ lc_opt_entry_t *lc_opt_get_grp(lc_opt_entry_t *parent, const char *name) 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); } @@ -242,7 +243,7 @@ lc_opt_entry_t *lc_opt_add_opt(lc_opt_entry_t *parent, 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