mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
AK: Don't use <random> on windows for ::rand()
This is the same as the libc function, just use the libc function.
This commit is contained in:
parent
06816deb78
commit
4aa70a07ca
Notes:
sideshowbarker
2024-07-17 03:22:07 +09:00
Author: https://github.com/alimpfard
Commit: 4aa70a07ca
Pull-request: https://github.com/SerenityOS/serenity/pull/16445
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/linusg
1 changed files with 2 additions and 3 deletions
|
@ -22,8 +22,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AK_OS_WINDOWS)
|
#if defined(AK_OS_WINDOWS)
|
||||||
# include <random>
|
# include <stdlib.h>
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
@ -38,7 +37,7 @@ inline void fill_with_random([[maybe_unused]] void* buffer, [[maybe_unused]] siz
|
||||||
#else
|
#else
|
||||||
char* char_buffer = static_cast<char*>(buffer);
|
char* char_buffer = static_cast<char*>(buffer);
|
||||||
for (size_t i = 0; i < length; i++) {
|
for (size_t i = 0; i < length; i++) {
|
||||||
char_buffer[i] = std::rand();
|
char_buffer[i] = rand();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue