Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: stahta01 on July 15, 2012, 01:02:46 am

Title: rndgen patch
Post by: stahta01 on July 15, 2012, 01:02:46 am
FYI:

I had trouble compiling the rndgen plug-in.

I used this patch to get it to Compile with MinGW GCC version 4.7.0 with added C++ Compiler options "-std=gnu++0x" and "-fpermissive".

Note: I have not tested the plug-in; I have no idea how to test the plug-in.

Tim S.

Code
Index: src/plugins/contrib/rndgen/rndgen.cpp
===================================================================
--- src/plugins/contrib/rndgen/rndgen.cpp (revision 8125)
+++ src/plugins/contrib/rndgen/rndgen.cpp (working copy)
@@ -11,11 +11,11 @@
 #define SCI_SETUNDOCOLLECTION 2012
 
 #if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
- #include <random>
+ #include <tr1/random>
     inline void ini_random() { };
  inline unsigned int random()
  {
- static std::mersenne_twister<unsigned int, 32, 624, 397, 31, 0x9908b0df, 11, 7, 0x9d2c5680, 15, 0xefc60000, 18> randgen(time(0));
+ static std::tr1::mersenne_twister<unsigned int, 32, 624, 397, 31, 0x9908b0df, 11, 7, 0x9d2c5680, 15, 0xefc60000, 18> randgen(time(0));
  return randgen();
  };
 #else