Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C90 compatible headers #2213

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/openssl/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,19 @@ extern "C" {
#if defined(__cplusplus)
#define OPENSSL_INLINE inline
#else

#if defined(__STDC__) && !defined(__STDC_VERSION__)
// C90 standard detected
#define AWS_LC_C90_COMPAT_REQUIRED
#define OPENSSL_INLINE static OPENSSL_UNUSED
#else
// C99 (or later) standard detected
// Add OPENSSL_UNUSED so that, should an inline function be emitted via macro
// (e.g. a |STACK_OF(T)| implementation) in a source file without tripping
// clang's -Wunused-function.
#define OPENSSL_INLINE static inline OPENSSL_UNUSED
#endif // defined(__STDC__) && !defined(__STDC_VERSION__)

#endif

// ossl_ssize_t is a signed type which is large enough to fit the size of any
Expand Down
4 changes: 4 additions & 0 deletions include/openssl/digest.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
#ifndef OPENSSL_HEADER_DIGEST_H
#define OPENSSL_HEADER_DIGEST_H

#ifndef AWS_LC_C90_COMPAT_REQUIRED
#include <stdbool.h>
#endif

#include <openssl/base.h>

Expand Down Expand Up @@ -360,12 +362,14 @@ struct env_md_ctx_st {

// General No-op Functions [Deprecated].

#ifndef AWS_LC_C90_COMPAT_REQUIRED
// EVP_MD_unstable_sha3_enable is a no-op as SHA3 is always enabled.
OPENSSL_EXPORT OPENSSL_DEPRECATED void EVP_MD_unstable_sha3_enable(bool enable);

// EVP_MD_unstable_sha3_is_enabled always returns true as SHA3 is always
// enabled.
OPENSSL_EXPORT OPENSSL_DEPRECATED bool EVP_MD_unstable_sha3_is_enabled(void);
#endif

// EVP_MD_CTX_set_flags does nothing. We strongly discourage doing any
// additional configurations when consuming |EVP_MD_CTX|.
Expand Down
Loading