Patch #3566 2014-04-13 12:03

linikov

rndgen: Fix compillation for mingw32 with c++11 defalt
Download
3566-rndgen_Fix_com.patch (706 bytes)
Category
Plugin::Bugfix
Status
Open
Close date
 
Assigned to
 
Index: src/plugins/contrib/rndgen/rndgen.cpp
===================================================================
--- src/plugins/contrib/rndgen/rndgen.cpp    (revision 9752)
+++ src/plugins/contrib/rndgen/rndgen.cpp    (working copy)
@@ -12,7 +12,15 @@
 
 #define SCI_SETUNDOCOLLECTION 2012
 
-#if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if defined(__GNUC__) && (__cplusplus >= 201103L)
+  #include <random>
+  inline void ini_random() { };
+    inline unsigned int random()
+    {
+        static std::mt19937 randgen(time(0));
+        return randgen();
+    };
+#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
     #include <random>
     inline void ini_random() { };
     inline unsigned int random()