Files
iphydf 40ce0bce66 cleanup: Use std::size_t in C++ to fix compilation errors.
On some stdlibs, `size_t` doesn't exist in the global namespace.

Fixes #3020.
2026-02-08 21:57:40 +00:00

34 lines
683 B
C++

#ifndef C_TOXCORE_TESTING_SUPPORT_RANDOM_H
#define C_TOXCORE_TESTING_SUPPORT_RANDOM_H
#include <cstddef>
#include <cstdint>
#include <vector>
#include "../../../toxcore/attributes.h"
// Forward declaration
struct Random;
namespace tox::test {
/**
* @brief Abstraction over the random number generator.
*/
class RandomSystem {
public:
virtual ~RandomSystem();
virtual uint32_t uniform(uint32_t upper_bound) = 0;
virtual void bytes(uint8_t *_Nonnull out, std::size_t count) = 0;
/**
* @brief Returns C-compatible Random struct.
*/
virtual struct Random c_random() = 0;
};
} // namespace tox::test
#endif // C_TOXCORE_TESTING_SUPPORT_RANDOM_H