<< "\" format has been defined.");
});
#else
- // This is not thread-safe.
- static bool first = true;
- if (first) {
- first = false;
- LYXERR0("PreviewLoader::startLoading()\n"
- << "No converter from \"" << from
- << "\" format has been defined.");
- }
+ // 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;
}