Skip to content

Instantly share code, notes, and snippets.

@MikeLing
Last active July 6, 2017 08:51
Show Gist options
  • Save MikeLing/c5d618c176a14aec06f3411ce1b30c5e to your computer and use it in GitHub Desktop.
Save MikeLing/c5d618c176a14aec06f3411ce1b30c5e to your computer and use it in GitHub Desktop.
// in init.hpp
__init32_t global_random_seed = CRandom::generate_seed();
// in CRanomd.hpp
extern __init32_t global_random_seed;
CRandom::CRandom() : m_sfmt_32(NULL),
m_sfmt_64(NULL),m_dsfmt(NULL)
{
// in this way, I will get undefined symbols for architecture x86_64 c++ error.
m_seed = global_random_seed;
init();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment