mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Provide fallback implementation of lrand48_r
darcs-hash:20060615105315-ac50b-155e1836d0bdc8f398776a816898718066adcdce.gz
This commit is contained in:
parent
4e38d3bc8c
commit
d677b468db
3 changed files with 39 additions and 1 deletions
|
@ -276,7 +276,7 @@ AC_CHECK_HEADER([regex.h],
|
||||||
# Check for presense of various functions
|
# Check for presense of various functions
|
||||||
AC_CHECK_FUNCS( wcsdup wcsndup wcslen wcscasecmp wcsncasecmp gettext fwprintf )
|
AC_CHECK_FUNCS( wcsdup wcsndup wcslen wcscasecmp wcsncasecmp gettext fwprintf )
|
||||||
AC_CHECK_FUNCS( futimes wcwidth wcswidth getopt_long wcstok fputwc fgetwc )
|
AC_CHECK_FUNCS( futimes wcwidth wcswidth getopt_long wcstok fputwc fgetwc )
|
||||||
AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy )
|
AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r)
|
||||||
|
|
||||||
# Here follows a list of small programs used to test for various
|
# Here follows a list of small programs used to test for various
|
||||||
# features that Autoconf doesn't tell us about
|
# features that Autoconf doesn't tell us about
|
||||||
|
|
15
fallback.c
15
fallback.c
|
@ -1005,3 +1005,18 @@ int del_curterm(TERMINAL *oterm)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LRAND48_R
|
||||||
|
|
||||||
|
int lrand48_r(struct drand48_data *buffer, long int *result)
|
||||||
|
{
|
||||||
|
*result = rand_r( &buffer->seed );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int srand48_r(long int seedval, struct drand48_data *buffer)
|
||||||
|
{
|
||||||
|
buffer->seed = (int)seedval;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
23
fallback.h
23
fallback.h
|
@ -292,4 +292,27 @@ size_t wcslcpy( wchar_t *dst, const wchar_t *src, size_t siz );
|
||||||
int del_curterm(TERMINAL *oterm);
|
int del_curterm(TERMINAL *oterm);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_LRAND48_R
|
||||||
|
|
||||||
|
/**
|
||||||
|
Datastructure for the lrand48_r fallback implementation.
|
||||||
|
*/
|
||||||
|
struct drand48_data
|
||||||
|
{
|
||||||
|
unsigned int seed;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fallback implementation of lrand48_r. Internally uses rand_r, so it is pretty weak.
|
||||||
|
*/
|
||||||
|
int lrand48_r(struct drand48_data *buffer, long int *result);
|
||||||
|
/**
|
||||||
|
Fallback implementation of srand48_r
|
||||||
|
*/
|
||||||
|
int srand48_r(long int seedval, struct drand48_data *buffer);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue