From c33f1a7c68b8b3eee350ffc4056ca3b086626dd9 Mon Sep 17 00:00:00 2001
From: Nathan Toone <nathan@toonetown.com>
Date: Fri, 24 Apr 2015 10:12:54 -0600
Subject: [PATCH] Inline rand function so it doesn't get multiply defined
(Addresses ticket #10487 - https://svn.boost.org/trac/boost/ticket/10487)
---
boost/iostreams/filter/test.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/boost/iostreams/filter/test.hpp b/boost/iostreams/filter/test.hpp
index ea2fd60..3b01fed 100644
a
|
b
|
const std::streamsize default_increment = 5;
|
71 | 71 | !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \ |
72 | 72 | !BOOST_WORKAROUND(__MWERKS__, <= 0x3003) \ |
73 | 73 | /**/ |
74 | | std::streamsize rand(int inc) |
| 74 | inline std::streamsize rand(int inc) |
75 | 75 | { |
76 | 76 | static rand48 random_gen; |
77 | 77 | static uniform_smallint<int> random_dist(0, inc); |
78 | 78 | return random_dist(random_gen); |
79 | 79 | } |
80 | 80 | #else |
81 | | std::streamsize rand(int inc) |
| 81 | inline std::streamsize rand(int inc) |
82 | 82 | { |
83 | 83 | return (std::rand() * inc + 1) / RAND_MAX; |
84 | 84 | } |