mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
![Linus Torvalds](/assets/img/avatar_default.png)
Add <limits.h> to the include files handled by "cache.h", and remove extraneous #include directives from various .c files. The rule is that "cache.h" gets all the basic stuff, so that we'll have as few system dependencies as possible.
40 lines
625 B
C
40 lines
625 B
C
/*
|
|
* GIT - The information manager from hell
|
|
*
|
|
* Copyright (C) Linus Torvalds, 2005
|
|
*/
|
|
#include "cache.h"
|
|
|
|
static void report(const char *prefix, const char *err, va_list params)
|
|
{
|
|
fputs(prefix, stderr);
|
|
vfprintf(stderr, err, params);
|
|
fputs("\n", stderr);
|
|
}
|
|
|
|
void usage(const char *err)
|
|
{
|
|
fprintf(stderr, "usage: %s\n", err);
|
|
exit(1);
|
|
}
|
|
|
|
void die(const char *err, ...)
|
|
{
|
|
va_list params;
|
|
|
|
va_start(params, err);
|
|
report("fatal: ", err, params);
|
|
va_end(params);
|
|
exit(1);
|
|
}
|
|
|
|
int error(const char *err, ...)
|
|
{
|
|
va_list params;
|
|
|
|
va_start(params, err);
|
|
report("error: ", err, params);
|
|
va_end(params);
|
|
return -1;
|
|
}
|