Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest code complain over random() on windows #309

Open
grodansparadis opened this issue Sep 4, 2015 · 2 comments
Open

latest code complain over random() on windows #309

grodansparadis opened this issue Sep 4, 2015 · 2 comments
Assignees

Comments

@grodansparadis
Copy link

Latest code don't compile on windows with vs 2015. Complain about random() not available in the

if NS_DISABLE_WS_RANDOM_MASK

return 0xefbeadde; /* generated with a random number generator, I swear */

else

if (sizeof(long) >= 4) {
return (uint32_t) random();
} else if (sizeof(long) == 2) {
return (uint32_t) random() << 16 | (uint32_t) random();
}

endif

}

@cpq cpq assigned mkmik Sep 4, 2015
@cpq
Copy link
Member

cpq commented Sep 4, 2015

@mmikulicic , i think this is due to the latest WS masking code
Perhaps #define random() rand() ?

@grodansparadis
Copy link
Author

OK I noticed the comment of not supported random(). But if this break on every windows it is maybe better to have the switch in the opposite way or default to rand if random is not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants