/*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2023 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
# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
/*
- * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
+ * Sometimes OPENSSL_NO_xxx ends up with an empty file and some compilers
* don't like that. This will hopefully silence them.
*/
# define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
/*
* Define macros for deprecation and simulated removal purposes.
*
- * The macros OSSL_DEPRECATED_{major}_{minor} are always defined for
+ * The macros OSSL_DEPRECATEDIN_{major}_{minor} are always defined for
* all OpenSSL versions we care for. They can be used as attributes
* in function declarations where appropriate.
*
* 'no-deprecated'.
*/
+# undef OPENSSL_NO_DEPRECATED_3_1
# undef OPENSSL_NO_DEPRECATED_3_0
# undef OPENSSL_NO_DEPRECATED_1_1_1
# undef OPENSSL_NO_DEPRECATED_1_1_0
# undef OPENSSL_NO_DEPRECATED_1_0_0
# undef OPENSSL_NO_DEPRECATED_0_9_8
+# if OPENSSL_API_LEVEL >= 30100
+# ifndef OPENSSL_NO_DEPRECATED
+# define OSSL_DEPRECATEDIN_3_1 OSSL_DEPRECATED(3.1)
+# define OSSL_DEPRECATEDIN_3_1_FOR(msg) OSSL_DEPRECATED_FOR(3.1, msg)
+# else
+# define OPENSSL_NO_DEPRECATED_3_1
+# endif
+# else
+# define OSSL_DEPRECATEDIN_3_1
+# define OSSL_DEPRECATEDIN_3_1_FOR(msg)
+# endif
# if OPENSSL_API_LEVEL >= 30000
# ifndef OPENSSL_NO_DEPRECATED
# define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)
# endif
# endif
+# ifndef OSSL_CRYPTO_ALLOC
+# if defined(__GNUC__)
+# define OSSL_CRYPTO_ALLOC __attribute__((__malloc__))
+# elif defined(_MSC_VER)
+# define OSSL_CRYPTO_ALLOC __declspec(restrict)
+# else
+# define OSSL_CRYPTO_ALLOC
+# endif
+# endif
+
#endif /* OPENSSL_MACROS_H */