Mailing List Archive



Back to the month index Back to the list index

Florin Radulescu (florin@cs.pub.ro)
Tue, 1 Apr 97 14:47:55 EET


From: Florin Radulescu <florin@cs.pub.ro>
Message-Id: <199704011247.OAA08210@apolo.cs.pub.ro>
Subject: [mSQL] Bug (?) in common/portability.h: rand/srand
Date: Tue, 1 Apr 97 14:47:55 EET

Hi,

I've tried to install msql v2b5 under HP-UX and the problem was compiling
lang-common/mod_std.c ("too few arguments to function srand" ... or something
like that)

In the mSQL faq there is something about that, but using the patch from the
faq, the error message is "too many arguments to function rand".

So, for those who want to install under HP-UX and have the same problem,
that cam be solved in this way:

Modify the file common/portability.h, line 44, this way:

#ifndef HAVE_RANDOM
# undef random
# undef srandom
# define random rand /* <-- this is line 44 */
# define srandom srand
#endif

----------------------------------------------------------------------
In the original common/portability.h there is:

#ifndef HAVE_RANDOM
# undef random
# undef srandom
# define random srand
# define srandom srand
#endif

In the msql faq, there is another wrong version:

#ifndef HAVE_RANDOM
# undef random
# undef srandom
# define random rand
# define srandom rand
#endif

I don't think that, on any system, random seed and random number functions
have the same form (srand or rand), but I may be wrong. Please tell me if
there are any operating systems with the same function for random seed and
random number.

So, I think that David must update common/portability.h.

Florin Radulescu,
PU Bucharest, Romania
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!