From 193cda6e48bb591675d401041cbff862cc61d869 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Sat, 20 Aug 2016 16:05:41 +0100 Subject: [PATCH] Remove unused variable warning and remove preprocessor switch. --- src/graphics/PreviewLoader.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index e9b1d47202..e1a47e8439 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -92,24 +92,15 @@ lyx::Converter const * setConverter(string const & from) return ptr; } - // Show the error only once -#ifdef LYX_USE_STD_CALL_ONCE - // This is thread-safe. - static once_flag flag; - call_once(flag, [&](){ - LYXERR0("PreviewLoader::startLoading()\n" - << "No converter from \"" << from - << "\" format has been defined."); - }); -#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; + // Show the error only once. This is thread-safe. + static nullptr_t no_conv = [&]{ + LYXERR0("PreviewLoader::startLoading()\n" + << "No converter from \"" << from + << "\" format has been defined."); + return nullptr; + } (); + + return no_conv; } -- 2.39.5