commit 193cda6e48bb591675d401041cbff862cc61d869
Author: Guillaume Munch <[email protected]>
Date:   Sat Aug 20 16:05:41 2016 +0100

    Remove unused variable warning and remove preprocessor switch.
---
 src/graphics/PreviewLoader.cpp |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index e9b1d47..e1a47e8 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;
 }
 
 

Reply via email to