]> git.lyx.org Git - lyx.git/commitdiff
Remove unused variable warning and remove preprocessor switch.
authorGuillaume Munch <gm@lyx.org>
Sat, 20 Aug 2016 15:05:41 +0000 (16:05 +0100)
committerGuillaume Munch <gm@lyx.org>
Sun, 21 Aug 2016 23:04:30 +0000 (00:04 +0100)
src/graphics/PreviewLoader.cpp

index e9b1d47202c2a4a4288a6f97227eeeddce48c66d..e1a47e84390a014880d69b23b41c917eb6c9b473 100644 (file)
@@ -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;
 }