diff options
author | Pauli <paul.dale@oracle.com> | 2019-04-30 12:36:16 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-05-01 00:37:11 +0200 |
commit | 39147079fc41b1af9a4e2974e89de20668e02aea (patch) | |
tree | 3d37a1466917d0ee1a4bf41b38180fee72863f49 /include | |
parent | Replumbing: give the possibility for the provider to create a context (diff) | |
download | openssl-39147079fc41b1af9a4e2974e89de20668e02aea.tar.xz openssl-39147079fc41b1af9a4e2974e89de20668e02aea.zip |
Structure alignment macro.
Introduce a macro that allows all structure alignment tricks to be rolled up
into a single place.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8845)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/cryptlib.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h index 28fd96e207..e791245ada 100644 --- a/include/internal/cryptlib.h +++ b/include/internal/cryptlib.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -42,6 +42,16 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr, #endif +/* + * Use this inside a union with the field that needs to be aligned to a + * reasonable boundary for the platform. The most pessimistic alignment + * of the listed types will be used by the compiler. + */ +# define OSSL_UNION_ALIGN \ + double align; \ + ossl_uintmax_t align_int; \ + void *align_ptr + typedef struct ex_callback_st EX_CALLBACK; DEFINE_STACK_OF(EX_CALLBACK) |