X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-private.h;h=53b4f1ddbc38882e8c29adc468cc9cde57e3eb85;hp=53ea75fa4d1c7bb09f2f08af50afd821b3ab0c5d;hb=7b227a6bf7eb409b4353adc430b2545166e0c4cd;hpb=3b8e3ab666a54407f9596a53c66ba8ce623ac91d diff --git a/notmuch-private.h b/notmuch-private.h index 53ea75fa..53b4f1dd 100644 --- a/notmuch-private.h +++ b/notmuch-private.h @@ -48,6 +48,20 @@ NOTMUCH_BEGIN_DECLS #define COMPILE_TIME_ASSERT(pred) ((void)sizeof(char[1 - 2*!(pred)])) +/* There's no point in continuing when we've detected that we've done + * something wrong internally (as opposed to the user passing in a + * bogus value). + * + * Note that __location__ comes from talloc.h. + */ +#define INTERNAL_ERROR(format, ...) \ + do { \ + fprintf(stderr, \ + "Internal error: " format " (%s)\n", \ + ##__VA_ARGS__, __location__); \ + exit (1); \ + } while (0) + /* Thanks to Andrew Tridgell's (SAMBA's) talloc for this definition of * unlikely. The talloc source code comes to us via the GNU LGPL v. 3. */