Defines OSSL_SSIZE_MAX
Removes SSIZE_MAX definition from bss_bio.c and changes that file to use OSSL_SSIZE_MAX. No need to account for OPENSSL_SYS_VXWORKS, since that never actually gets defined anywhere. It must be a historical artifact. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Ben Laurie <ben@openssl.org>
This commit is contained in:
@@ -71,14 +71,6 @@
|
|||||||
|
|
||||||
#include "e_os.h"
|
#include "e_os.h"
|
||||||
|
|
||||||
/* VxWorks defines SSIZE_MAX with an empty value causing compile errors */
|
|
||||||
#if defined(OPENSSL_SYS_VXWORKS)
|
|
||||||
# undef SSIZE_MAX
|
|
||||||
#endif
|
|
||||||
#ifndef SSIZE_MAX
|
|
||||||
# define SSIZE_MAX INT_MAX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int bio_new(BIO *bio);
|
static int bio_new(BIO *bio);
|
||||||
static int bio_free(BIO *bio);
|
static int bio_free(BIO *bio);
|
||||||
static int bio_read(BIO *bio, char *buf, int size);
|
static int bio_read(BIO *bio, char *buf, int size);
|
||||||
@@ -294,8 +286,8 @@ static ossl_ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
|
|||||||
struct bio_bio_st *b, *peer_b;
|
struct bio_bio_st *b, *peer_b;
|
||||||
ossl_ssize_t num, available;
|
ossl_ssize_t num, available;
|
||||||
|
|
||||||
if (num_ > SSIZE_MAX)
|
if (num_ > OSSL_SSIZE_MAX)
|
||||||
num = SSIZE_MAX;
|
num = OSSL_SSIZE_MAX;
|
||||||
else
|
else
|
||||||
num = (ossl_ssize_t) num_;
|
num = (ossl_ssize_t) num_;
|
||||||
|
|
||||||
@@ -450,8 +442,8 @@ static ossl_ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_)
|
|||||||
struct bio_bio_st *b;
|
struct bio_bio_st *b;
|
||||||
ossl_ssize_t num, space;
|
ossl_ssize_t num, space;
|
||||||
|
|
||||||
if (num_ > SSIZE_MAX)
|
if (num_ > OSSL_SSIZE_MAX)
|
||||||
num = SSIZE_MAX;
|
num = OSSL_SSIZE_MAX;
|
||||||
else
|
else
|
||||||
num = (ossl_ssize_t) num_;
|
num = (ossl_ssize_t) num_;
|
||||||
|
|
||||||
|
@@ -262,17 +262,21 @@ extern "C" {
|
|||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
# ifdef _WIN64
|
# ifdef _WIN64
|
||||||
# define ossl_ssize_t __int64
|
# define ossl_ssize_t __int64
|
||||||
|
# define OSSL_SSIZE_MAX _I64_MAX
|
||||||
# else
|
# else
|
||||||
# define ossl_ssize_t int
|
# define ossl_ssize_t int
|
||||||
|
# define OSSL_SSIZE_MAX INT_MAX
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(__ultrix) && !defined(ssize_t)
|
# if defined(__ultrix) && !defined(ssize_t)
|
||||||
# define ossl_ssize_t int
|
# define ossl_ssize_t int
|
||||||
|
# define OSSL_SSIZE_MAX INT_MAX
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifndef ossl_ssize_t
|
# ifndef ossl_ssize_t
|
||||||
# define ossl_ssize_t ssize_t
|
# define ossl_ssize_t ssize_t
|
||||||
|
# define OSSL_SSIZE_MAX SSIZE_MAX
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef DEBUG_UNUSED
|
# ifdef DEBUG_UNUSED
|
||||||
|
Reference in New Issue
Block a user