X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=include%2Fopenssl%2Fsafestack.h;h=fb8d9104cd9386252593f2b074736483410101b3;hp=d0af0eba5df0b3300b6ed39e8a85ade95c903567;hb=1dcb8ca2a4aa71964105b24fa7c6254a58b7ad35;hpb=739a1eb1961cdc3b1597a040766f3cb359d095f6 diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h index d0af0eba5d..fb8d9104cd 100644 --- a/include/openssl/safestack.h +++ b/include/openssl/safestack.h @@ -54,7 +54,8 @@ extern "C" { } \ static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (void *)ptr); \ + return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \ + (const void *)ptr); \ } \ static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \ { \ @@ -86,11 +87,11 @@ extern "C" { } \ static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return OPENSSL_sk_find((OPENSSL_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \ } \ static ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \ } \ static ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \ { \ @@ -119,6 +120,8 @@ extern "C" { # define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) # define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) +# define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \ + SKM_DEFINE_STACK_OF(t1, const t2, t2) # define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t) /*- @@ -146,6 +149,7 @@ typedef const char *OPENSSL_CSTRING; * dealt with in the autogenerated macros below. */ DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) +DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char) /* * Similarly, we sometimes use a block of characters, NOT nul-terminated.