Bug#108619: libc6-dev: add __USE_BSD to [s]random guard
At Sat, 09 Nov 2002 20:23:56 +0100,
Martin Waitz wrote:
>
> Package: libc6-dev
> Version: 2.3.1-3
> Followup-For: Bug #108619
>
> hi :)
>
> undefined srandom hit me when trying to get isakmpd to compile on
> debian.
>
> well, it's only a warning: implicit declaration of function `srandom'
> but anyway...
>
>
> the following fixes it for me, don't know if this is according
> to specs and if other lines have to be changed, too
>
>
> --- /usr/include/stdlib.h.orig 2002-11-09 19:37:17.000000000 +0100
> +++ /usr/include/stdlib.h 2002-11-09 19:38:03.000000000 +0100
> @@ -401,7 +401,7 @@
> #endif /* Optimizing and Inlining. */
>
>
> -#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
> +#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
> /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
> digit first. Returns a pointer to static storage overwritten by the
> next call. */
Hmm, this patch has a bit problem because it includes __USE_BSD for l64a and
a64a which are not BSD derived, but XPG4. Does below patch look fine?
--- libc/stdlib/stdlib.h 2002-08-28 17:01:10.000000000 +0900
+++ stdlib.h 2003-01-05 21:09:19.000000000 +0900
@@ -410,7 +410,9 @@
/* Read a number from a string S in base 64 as above. */
extern long int a64l (__const char *__s) __THROW __attribute_pure__;
+#endif /* Use SVID || extended X/Open. */
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
# include <sys/types.h> /* we need int32_t... */
/* These are the functions that actually do things. The `random', `srandom',
@@ -463,7 +465,7 @@
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf) __THROW;
# endif /* Use misc. */
-#endif /* Use SVID || extended X/Open. */
+#endif /* Use SVID || extended X/Open || BSD. */
__BEGIN_NAMESPACE_STD
-- gotom
Reply to: