From 07bf05a7869c88c27912833c1db942f8fc849f4d Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 11 Jun 2023 20:12:29 -0600 Subject: pkgs: add existing derivations written for other projects --- pkgs/force-riscv/urbg-static-constexpr-min-max.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkgs/force-riscv/urbg-static-constexpr-min-max.patch (limited to 'pkgs/force-riscv/urbg-static-constexpr-min-max.patch') diff --git a/pkgs/force-riscv/urbg-static-constexpr-min-max.patch b/pkgs/force-riscv/urbg-static-constexpr-min-max.patch new file mode 100644 index 0000000..a047fd0 --- /dev/null +++ b/pkgs/force-riscv/urbg-static-constexpr-min-max.patch @@ -0,0 +1,15 @@ +diff --git a/base/inc/Random.h b/base/inc/Random.h +index 6354dee..21660a9 100644 +--- a/base/inc/Random.h ++++ b/base/inc/Random.h +@@ -56,8 +56,8 @@ namespace Force { + class RandomURBG32 { + public: + typedef uint32 result_type; //!< Type define required by STL +- uint32 min() const { return 0; } //!< min function required by STL +- uint32 max() const { return MAX_UINT32; } //!< max function required by STL ++ static constexpr uint32 min() { return 0; } //!< min function required by STL ++ static constexpr uint32 max() { return MAX_UINT32; } //!< max function required by STL + uint32 operator () () const { return mpRandomInstance->Random32(min(), max()); } + + explicit RandomURBG32(const Random* randomInstance) : mpRandomInstance(randomInstance) { } //!< Constructor with pointer to a Random object provieded. -- cgit v1.2.3