Author Topic: rndgen patch  (Read 3877 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7070
    • My Best Post
rndgen patch
« 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
« Last Edit: July 15, 2012, 01:06:47 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org