X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Flib%2Fgeneral%2Frandom.h;h=c643c3e42250218bdb55109c5da82ef47aab65be;hb=HEAD;hp=13dc01703e21bf1fce522f7b2f45f81c46c0adfe;hpb=18a684bf3dc144c48fc4cc6cc72f5070febd8074;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/lib/general/random.h b/gnuradio-core/src/lib/general/random.h index 13dc0170..c643c3e4 100644 --- a/gnuradio-core/src/lib/general/random.h +++ b/gnuradio-core/src/lib/general/random.h @@ -1,12 +1,12 @@ /* -*- c++ -*- */ /* - * Copyright 2003 Free Software Foundation, Inc. + * Copyright 2003, 2008 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) + * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, @@ -23,9 +23,15 @@ #ifndef _RANDOM_H_ #define _RANDOM_H_ -// we use this because some systems (solaris) define RAND_MAX as 32767 +// While rand(3) specifies RAND_MAX, random(3) says that the output +// ranges from 0 to 2^31-1 but does not specify a macro to denote +// this. We define RANDOM_MAX for cleanliness. We must omit the +// definition for systems that have made the same choice. (Note that +// random(3) is from 4.2BSD, and not specified by POSIX.) -static const int RANDOM_MAX = 2147483647; +#ifndef RANDOM_MAX +static const int RANDOM_MAX = 2147483647; // 2^31-1 +#endif /* RANDOM_MAX */ #include