summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/random.cxx4
-rw-r--r--include/comphelper/random.hxx4
2 files changed, 8 insertions, 0 deletions
diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx
index 4fb4a1fde08d..c695ed12a2f7 100644
--- a/comphelper/source/misc/random.cxx
+++ b/comphelper/source/misc/random.cxx
@@ -66,6 +66,8 @@ unsigned int uniform_int_distribution(unsigned int a, unsigned int b)
return dist(theRandomNumberGenerator::get().global_rng);
}
+#if SAL_TYPES_SIZEOFLONG == 8
+
// uniform size_t [a,b] distribution
size_t uniform_int_distribution(size_t a, size_t b)
{
@@ -73,6 +75,8 @@ size_t uniform_int_distribution(size_t a, size_t b)
return dist(theRandomNumberGenerator::get().global_rng);
}
+#endif
+
// uniform size_t [a,b) distribution
double uniform_real_distribution(double a, double b)
{
diff --git a/include/comphelper/random.hxx b/include/comphelper/random.hxx
index e7051a860403..7c149fbe8cd9 100644
--- a/include/comphelper/random.hxx
+++ b/include/comphelper/random.hxx
@@ -34,9 +34,13 @@ COMPHELPER_DLLPUBLIC int uniform_int_distribution(int a, int b);
/// uniform distribution in [a,b]
COMPHELPER_DLLPUBLIC unsigned int uniform_int_distribution(unsigned int a, unsigned int b);
+#if SAL_TYPES_SIZEOFLONG == 8
+
/// uniform distribution in [a,b]
COMPHELPER_DLLPUBLIC size_t uniform_int_distribution(size_t a, size_t b);
+#endif
+
} // namespace
} // namespace