mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 14:00:09 -10:00
Causing a build failure on Mac/Clang:
./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens]
#else if defined(_MSC_VER)
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136
This reverts commit 3b26e231d9.
Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7
Reviewed-on: https://chromium-review.googlesource.com/264983
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
23 lines
547 B
C++
23 lines
547 B
C++
//
|
|
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
//
|
|
|
|
#include "random_utils.h"
|
|
#include <time.h>
|
|
#include <cstdlib>
|
|
|
|
float RandomBetween(float min, float max)
|
|
{
|
|
static bool randInitialized = false;
|
|
if (!randInitialized)
|
|
{
|
|
srand(time(NULL));
|
|
randInitialized = true;
|
|
}
|
|
|
|
const size_t divisor = 10000;
|
|
return min + ((rand() % divisor) / static_cast<float>(divisor)) * (max - min);
|
|
}
|