X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=diagnostic.h;fp=diagnostic.h;h=820c7194a0b88549274f75018245f11f1091602b;hb=5c804a26fbf22e58afedba1551d31f63d81d4d84;hp=5e8e0aa302f617a0e13e1bea81716beca6cf52e3;hpb=25963fb99021d505f5382e3251e96a76eb97c675;p=cparser diff --git a/diagnostic.h b/diagnostic.h index 5e8e0aa..820c719 100644 --- a/diagnostic.h +++ b/diagnostic.h @@ -23,9 +23,28 @@ #include #include "token_t.h" +/* define a NORETURN attribute */ +#ifndef NORETURN +# if defined(__GNUC__) +# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70) +# define NORETURN void __attribute__ ((noreturn)) +# endif /* __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70) */ +# endif /* defined(__GNUC__) */ + +# if defined(_MSC_VER) +# define NORETURN void __declspec(noreturn) +# endif /* defined(_MSC_VER) */ + +/* If not set above, use "void" for DOES_NOT_RETURN. */ +# ifndef NORETURN +# define NORETURN void +# endif /* ifndef NORETURN */ +#endif /* ifndef NORETURN */ + void diagnosticf(const char *fmt, ...); void errorf(source_position_t pos, const char *fmt, ...); void warningf(source_position_t pos, const char *fmt, ...); +NORETURN internal_errorf(source_position_t pos, const char *fmt, ...); extern unsigned diagnostic_count; extern unsigned error_count;