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;
|
if (!gcWarning) return;
|
||||||
static bool haveWarned = false;
|
static bool haveWarned = false;
|
||||||
warnOnce(haveWarned,
|
if (!haveWarned) {
|
||||||
"you did not specify '--add-root'; "
|
haveWarned = true;
|
||||||
"the result might be removed by the garbage collector");
|
warn(
|
||||||
|
"you did not specify '--add-root'; "
|
||||||
|
"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());
|
logger->warn(HintFmt(fs, args...).str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#define warnOnce(haveWarned, args...) \
|
|
||||||
if (!haveWarned) { \
|
|
||||||
haveWarned = true; \
|
|
||||||
warn(args); \
|
|
||||||
}
|
|
||||||
|
|
||||||
void writeToStderr(std::string_view s);
|
void writeToStderr(std::string_view s);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue