summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-01-13 18:23:09 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-01-13 18:23:09 +0000
commit0d5c1ec01e2ab459847c240551cec2db9a6a2a90 (patch)
tree97b7a8aa06d343bad667a37d2c806871ee647556
parent5c7c7e474732f7852727b54ecca94a28d6abc310 (diff)
downloadlibapr-0d5c1ec01e2ab459847c240551cec2db9a6a2a90.tar.gz
While this is a 'proper' change, it breaks 64 bit platforms.
Identify as "this will change" with the 1.0 (or 0.10) generation. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64290 13f79535-47bb-0310-9956-ffa450edef68
-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;