forked from lix-project/lix
libutil: remove warnOnce macro
it's only used once, and even that one use is highly questionable. more
instances of warnOnce should be much more principled than this has been
Change-Id: I5856570c99cb44462e700d753d0c706a5db03c4b
This commit is contained in:
parent
22252825c4
commit
d8c09b5836
|
@ -33,9 +33,13 @@ void printGCWarning()
|
|||
{
|
||||
if (!gcWarning) return;
|
||||
static bool haveWarned = false;
|
||||
warnOnce(haveWarned,
|
||||
if (!haveWarned) {
|
||||
haveWarned = true;
|
||||
warn(
|
||||
"you did not specify '--add-root'; "
|
||||
"the result might be removed by the garbage collector");
|
||||
"the result might be removed by the garbage collector"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -283,12 +283,6 @@ inline void warn(const std::string & fs, const Args & ... args)
|
|||
logger->warn(HintFmt(fs, args...).str());
|
||||
}
|
||||
|
||||
#define warnOnce(haveWarned, args...) \
|
||||
if (!haveWarned) { \
|
||||
haveWarned = true; \
|
||||
warn(args); \
|
||||
}
|
||||
|
||||
void writeToStderr(std::string_view s);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue