summaryrefslogtreecommitdiff
path: root/pkgs/force-riscv/urbg-static-constexpr-min-max.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/force-riscv/urbg-static-constexpr-min-max.patch')
-rw-r--r--pkgs/force-riscv/urbg-static-constexpr-min-max.patch15
1 files changed, 15 insertions, 0 deletions
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.