X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fgenksyms%2Fgenksyms.h;h=f09af47ab2814baffbc5269ecbe3cc34f567f159;hb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;hp=7b711731abf27c62c2ab37ec1addd58f08a71400;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 7b711731a..f09af47ab 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -25,7 +25,6 @@ #define MODUTILS_GENKSYMS_H 1 #include -#include enum symbol_type @@ -89,8 +88,17 @@ void error_with_pos(const char *, ...); #define MODUTILS_VERSION "" -#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; }) -#define xstrdup(str) ({ char *__str = strdup(str); assert(__str); __str; }) - +#define xmalloc(size) ({ void *__ptr = malloc(size); \ + if(!__ptr && size != 0) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __ptr; }) +#define xstrdup(str) ({ char *__str = strdup(str); \ + if (!__str) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __str; }) #endif /* genksyms.h */