X-Git-Url: https://pd.if.org/git/?p=lice;a=blobdiff_plain;f=lice.h;fp=lice.h;h=d35811632c8cfed92647d27f903a2117c8165255;hp=0000000000000000000000000000000000000000;hb=d41dc131c73a91d200dbffab3a7786f6b2b51489;hpb=c9d92e71ffc96475abe19bd7dc7512df89b4f44d diff --git a/lice.h b/lice.h new file mode 100644 index 0000000..d358116 --- /dev/null +++ b/lice.h @@ -0,0 +1,63 @@ +#ifndef LICE_HDR +#define LICE_HDR +#include "util.h" + +#ifdef LICE_TARGET_AMD64 +# include "arch_amd64.h" +#else + /* + * Any additional future targets will just keep bracing with + * conditional inclusion here. + */ +# include "arch_dummy.h" +#endif + +#ifdef __GNUC__ +# define NORETURN __attribute__((noreturn)) +#else +# define NORETURN +#endif + +/* + * Function: compile_error + * Write compiler error diagnostic to stderr, formatted + * + * Parameters: + * fmt - Standard format specification string + * ... - Additional variable arguments + * + * Remarks: + * This function does not return, it kills execution via a call to + * exit(1); + */ +void NORETURN compile_error(const char *fmt, ...); + +/* + * Function: compile_warn + * Write compiler warning diagnostic to stderr, formatted + * + * Parameters: + * fmt - Standard format specification string + * ... - Additional variable arguments + */ +void compile_warn(const char *fmt, ...); + +/* + * Function: compile_ice + * Write an internal compiler error diagnostic to stderr, formatted + * and abort. + * + * Parameters: + * fmt - Standard format specification string + * ... - Additional variable arguments + * + * Remarks: + * Thie function does not return, it aborts execution via a call to + * abort() + */ +void NORETURN compile_ice(const char *fmt, ...); + +/* TODO: eliminate */ +extern bool compile_warning; + +#endif