Fixes to get -ansi working
authorJeffrey Walton <noloader@gmail.com>
Wed, 8 Jun 2016 19:10:50 +0000 (20:10 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 8 Jun 2016 19:18:04 +0000 (20:18 +0100)
Various fixes to get the following to compile:

./config no-asm -ansi -D_DEFAULT_SOURCE

RT4479
RT4480

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/async/arch/async_posix.h
engines/afalg/e_afalg.c
include/openssl/e_os2.h
test/ssltest_old.c

index 0d9245ebe9241a6e44413c542263d2dda67c14eb..3c61f7f7b0818de8654fa12fedd4f3a914d1a19c 100644 (file)
@@ -34,7 +34,7 @@ typedef struct async_fibre_st {
     int env_init;
 } async_fibre;
 
     int env_init;
 } async_fibre;
 
-static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
+static ossl_inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
 {
     o->env_init = 1;
 
 {
     o->env_init = 1;
 
index ec2a57e5a94ea3638ff57a4fa93fba626d7ebf60..2d6fa58b9f7746ec6a2ece05df3832cdb9eb8d1b 100644 (file)
@@ -94,27 +94,27 @@ static int afalg_cipher_nids[] = {
 
 static EVP_CIPHER *_hidden_aes_128_cbc = NULL;
 
 
 static EVP_CIPHER *_hidden_aes_128_cbc = NULL;
 
-static inline int io_setup(unsigned n, aio_context_t *ctx)
+static ossl_inline int io_setup(unsigned n, aio_context_t *ctx)
 {
     return syscall(__NR_io_setup, n, ctx);
 }
 
 {
     return syscall(__NR_io_setup, n, ctx);
 }
 
-static inline int eventfd(int n)
+static ossl_inline int eventfd(int n)
 {
     return syscall(__NR_eventfd, n);
 }
 
 {
     return syscall(__NR_eventfd, n);
 }
 
-static inline int io_destroy(aio_context_t ctx)
+static ossl_inline int io_destroy(aio_context_t ctx)
 {
     return syscall(__NR_io_destroy, ctx);
 }
 
 {
     return syscall(__NR_io_destroy, ctx);
 }
 
-static inline int io_read(aio_context_t ctx, long n, struct iocb **iocb)
+static ossl_inline int io_read(aio_context_t ctx, long n, struct iocb **iocb)
 {
     return syscall(__NR_io_submit, ctx, n, iocb);
 }
 
 {
     return syscall(__NR_io_submit, ctx, n, iocb);
 }
 
-static inline int io_getevents(aio_context_t ctx, long min, long max,
+static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
                                struct io_event *events,
                                struct timespec *timeout)
 {
                                struct io_event *events,
                                struct timespec *timeout)
 {
@@ -230,7 +230,7 @@ int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
     memset(cb, '\0', sizeof(*cb));
     cb->aio_fildes = sfd;
     cb->aio_lio_opcode = IOCB_CMD_PREAD;
     memset(cb, '\0', sizeof(*cb));
     cb->aio_fildes = sfd;
     cb->aio_lio_opcode = IOCB_CMD_PREAD;
-    cb->aio_buf = (unsigned long)buf;
+    cb->aio_buf = (uint64_t)buf;
     cb->aio_offset = 0;
     cb->aio_data = 0;
     cb->aio_nbytes = len;
     cb->aio_offset = 0;
     cb->aio_data = 0;
     cb->aio_nbytes = len;
@@ -310,7 +310,7 @@ int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
     return 1;
 }
 
     return 1;
 }
 
-static inline void afalg_set_op_sk(struct cmsghdr *cmsg,
+static ossl_inline void afalg_set_op_sk(struct cmsghdr *cmsg,
                                    const unsigned int op)
 {
     cmsg->cmsg_level = SOL_ALG;
                                    const unsigned int op)
 {
     cmsg->cmsg_level = SOL_ALG;
@@ -332,7 +332,7 @@ static void afalg_set_iv_sk(struct cmsghdr *cmsg, const unsigned char *iv,
     memcpy(aiv->iv, iv, len);
 }
 
     memcpy(aiv->iv, iv, len);
 }
 
-static inline int afalg_set_key(afalg_ctx *actx, const unsigned char *key,
+static ossl_inline int afalg_set_key(afalg_ctx *actx, const unsigned char *key,
                                 const int klen)
 {
     int ret;
                                 const int klen)
 {
     int ret;
index e0a5e46a6b33b62fdc73e96db6019d28bf848a4e..198ebdfc8858d078fdecad8a3651890e4d703b8b 100644 (file)
@@ -219,7 +219,11 @@ extern "C" {
 
 # ifndef ossl_ssize_t
 #  define ossl_ssize_t ssize_t
 
 # ifndef ossl_ssize_t
 #  define ossl_ssize_t ssize_t
-#  define OSSL_SSIZE_MAX SSIZE_MAX
+#  if defined(SSIZE_MAX)
+#   define OSSL_SSIZE_MAX SSIZE_MAX
+#  elif defined(_POSIX_SSIZE_MAX)
+#   define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
+#  endif
 # endif
 
 # ifdef DEBUG_UNUSED
 # endif
 
 # ifdef DEBUG_UNUSED
index f7db91c31db29f30d963cf4672376251658dd346..bc73380146fefb3e297cce54dc6228b42589552b 100644 (file)
  */
 
 /* Or gethostname won't be declared properly on Linux and GNU platforms. */
  */
 
 /* Or gethostname won't be declared properly on Linux and GNU platforms. */
-#define _BSD_SOURCE 1
-#define _DEFAULT_SOURCE 1
+#ifndef _BSD_SOURCE
+# define _BSD_SOURCE 1
+#endif
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
 
 #include <assert.h>
 #include <errno.h>
 
 #include <assert.h>
 #include <errno.h>