One alternative is of course to have a separate function that has a reference implementation [a'la the above code sample], which is called by your code, and it's up to the target system user to implement a correct function for their platform. And that may include something along this if they want to:
Code:
int getRandomSeed()
{
const static int seeds[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, ... };
static int index = 5;
static int index2 = 1;
int r;
r = seeds[index] * seeds[index1];
index = (index + 1) % sizeof(seeds)/sizeof(seeds[0]);
if (!index) index1 = (index1 + 1) sizeof(seeds)/sizeof(seeds[0]);
return r;
}
Obviously "seeds" above needs to be fairly large to make it viable for MANY calls, but at least it's square the size, so 1000 gives you 1 million combinations. [And they don't have to be prime numbers of course - just any combination of not so sequential numbers].
--
Mats