xref: /llvm-project/libc/src/stdlib/srand.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
138b6f58eSMichael Jones //===-- Implementation of srand -------------------------------------------===//
238b6f58eSMichael Jones //
338b6f58eSMichael Jones // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
438b6f58eSMichael Jones // See https://llvm.org/LICENSE.txt for license information.
538b6f58eSMichael Jones // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
638b6f58eSMichael Jones //
738b6f58eSMichael Jones //===----------------------------------------------------------------------===//
838b6f58eSMichael Jones 
938b6f58eSMichael Jones #include "src/stdlib/srand.h"
1038b6f58eSMichael Jones #include "src/__support/common.h"
11*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
1238b6f58eSMichael Jones #include "src/stdlib/rand_util.h"
1338b6f58eSMichael Jones 
14*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
1538b6f58eSMichael Jones 
1686860be2SJoseph Huber LLVM_LIBC_FUNCTION(void, srand, (unsigned int seed)) {
1786860be2SJoseph Huber   rand_next.store(seed, cpp::MemoryOrder::RELAXED);
1886860be2SJoseph Huber }
1938b6f58eSMichael Jones 
20*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
21