mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
Remove unused variable warning and remove preprocessor switch.
This commit is contained in:
parent
6adf079796
commit
193cda6e48
@ -92,24 +92,15 @@ lyx::Converter const * setConverter(string const & from)
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the error only once
|
// Show the error only once. This is thread-safe.
|
||||||
#ifdef LYX_USE_STD_CALL_ONCE
|
static nullptr_t no_conv = [&]{
|
||||||
// This is thread-safe.
|
LYXERR0("PreviewLoader::startLoading()\n"
|
||||||
static once_flag flag;
|
<< "No converter from \"" << from
|
||||||
call_once(flag, [&](){
|
<< "\" format has been defined.");
|
||||||
LYXERR0("PreviewLoader::startLoading()\n"
|
return nullptr;
|
||||||
<< "No converter from \"" << from
|
} ();
|
||||||
<< "\" format has been defined.");
|
|
||||||
});
|
return no_conv;
|
||||||
#else
|
|
||||||
// This is also thread-safe according to §6.7.4 of the C++11 standard.
|
|
||||||
static bool once = ([&]{
|
|
||||||
LYXERR0("PreviewLoader::startLoading()\n"
|
|
||||||
<< "No converter from \"" << from
|
|
||||||
<< "\" format has been defined.");
|
|
||||||
} (), true);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user