summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-07-14 18:04:14 -0700
committerBrad Linden <brad@lindenlab.com>2023-07-14 18:05:44 -0700
commit0998d46f47927badbd3f7d3a4b7a83a11896a5c9 (patch)
treedd6247e630ae35c8147da9e2527d96d9604bd2d1
parenta163931b773eb9c863b804eb4af1e63e398e6360 (diff)
Fix "intermittent" llrand unit test failure on windows on DRTVWR-578. we must return less than 1.0 when rand() returns RAND_MAX
also, disable 32 bit build now that we have deprecated it. https://community.secondlife.com/blogs/entry/13464-end-of-support-for-second-life-32-bit-windows-viewer-and-updated-minimum-system-requirements-for-macos-to-1013/
-rw-r--r--.github/workflows/build.yaml8
-rw-r--r--indra/llcommon/llrand.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 00dd7ed116..3e0330d77b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -13,18 +13,14 @@ jobs:
matrix:
runner: [windows-large, macos-12-xl]
configuration: [Release]
- addrsize: [64]
python-version: ["3.11"]
include:
- - runner: windows-large
- configuration: Release
- addrsize: 32
- python-version: "3.11"
- runner: macos-12-xl
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
+ python-version: "3.11"
runs-on: ${{ matrix.runner }}
env:
- AUTOBUILD_ADDRSIZE: ${{ matrix.addrsize }}
+ AUTOBUILD_ADDRSIZE: 64
AUTOBUILD_CONFIGURATION: ${{ matrix.configuration }}
# authorizes fetching private constituent packages
AUTOBUILD_GITHUB_TOKEN: ${{ secrets.SHARED_AUTOBUILD_GITHUB_TOKEN }}
diff --git a/indra/llcommon/llrand.cpp b/indra/llcommon/llrand.cpp
index cb28a8f5c3..1b6963a9dd 100644
--- a/indra/llcommon/llrand.cpp
+++ b/indra/llcommon/llrand.cpp
@@ -82,7 +82,7 @@ static LLSeedRand sRandomSeeder;
inline F64 ll_internal_random_double()
{
#if LL_WINDOWS
- return (F64)rand() / (F64)RAND_MAX;
+ return (F64)rand() / (F64)(RAND_MAX+1);
#else
return drand48();
#endif
@@ -90,7 +90,7 @@ inline F64 ll_internal_random_double()
inline F32 ll_internal_random_float()
{
#if LL_WINDOWS
- return (F32)rand() / (F32)RAND_MAX;
+ return (F32)rand() / (F32)(RAND_MAX+1);
#else
return (F32)drand48();
#endif