summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/apr_general.h11
-rw-r--r--misc/netware/rand.c6
-rw-r--r--misc/unix/rand.c4
-rw-r--r--misc/win32/rand.c4
4 files changed, 21 insertions, 4 deletions
diff --git a/include/apr_general.h b/include/apr_general.h
index d01a09921..cabdcb951 100644
--- a/include/apr_general.h
+++ b/include/apr_general.h
@@ -260,14 +260,19 @@ APR_DECLARE(void) apr_terminate2(void);
#if APR_HAS_RANDOM
+#ifdef APR_ENABLE_FOR_1_0
+APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
+ apr_size_t length);
+#else
/* TODO: I'm not sure this is the best place to put this prototype...*/
/**
* Generate random bytes.
- * @param buf Random bytes go here
- * @param length number of bytes to read
+ * @param buf Buffer to fill with random bytes
+ * @param length Length of buffer in bytes (becomes apr_size_t in APR 1.0)
*/
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
- apr_size_t length);
+ int length);
+#endif
#endif
/** @} */
diff --git a/misc/netware/rand.c b/misc/netware/rand.c
index 5042e069c..44425ea4a 100644
--- a/misc/netware/rand.c
+++ b/misc/netware/rand.c
@@ -62,7 +62,11 @@
#include <nks/plat.h>
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
- apr_size_t length)
+#ifdef APR_ENABLE_FOR_1_0
+ apr_size_t length)
+#else
+ int length)
+#endif
{
return NXSeedRandom(length, buf);
}
diff --git a/misc/unix/rand.c b/misc/unix/rand.c
index 0e0683beb..c8e920c2f 100644
--- a/misc/unix/rand.c
+++ b/misc/unix/rand.c
@@ -81,7 +81,11 @@
#if APR_HAS_RANDOM
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
+#ifdef APR_ENABLE_FOR_1_0
apr_size_t length)
+#else
+ int length)
+#endif
{
#ifdef DEV_RANDOM
diff --git a/misc/win32/rand.c b/misc/win32/rand.c
index 29999d61b..fa43aebd9 100644
--- a/misc/win32/rand.c
+++ b/misc/win32/rand.c
@@ -61,7 +61,11 @@
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
+#ifdef APR_ENABLE_FOR_1_0
apr_size_t length)
+#else
+ int length)
+#endif
{
HCRYPTPROV hProv;
apr_status_t res = APR_SUCCESS;