News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

rndgen patch

Started by stahta01, July 15, 2012, 01:02:46 AM

Previous topic - Next topic

stahta01

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.


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
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]