OPENSSL_USER_MACROS(7ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… OPENSSL_USER_MACROS β€” user defined macros (7ossl, bestie!)

okay so this is the openssl_user_macros page, and it's literally the glow-up guide for OPENSSL_API_COMPAT and OPENSSL_NO_DEPRECATED. it's part of the OpenSSL fam, so you already know it's iconic ✨


🌸 DESCRIPTION 🌸

so, user defined macros? they let you, the programmer, control certain aspects of what gets exposed by the OpenSSL headers. it's giving "i decide what's on the menu" energy. πŸ’…

⚠️ NOTE, and this one's important bestie: to be effective, a user defined macro has to be defined before you include any header file that depends on it. two ways to do that: either right in the compilation command (cc -DMACRO=value), or by defining the macro in the source before including any headers. order matters, no cap. 🫢

also, other manual pages may refer to this page when declarations depend on user defined macros β€” so yeah, she's basically the reference queen for other pages. πŸ‘‘

✨ The macros ✨

  • OPENSSL_API_COMPAT β€” the value is a version number, and you can give it in one of the following two forms:
    • "0xMNNFF000L" β€” this is the form supported for all versions up to 1.1.x, where "M" is the major number, "NN" is the minor number, and "FF" is the fix number, all as a hexadecimal number. for version 1.1.0, that's "0x10100000L". πŸŽ€

any version number may be given, but these numbers are the current known major deprecation points, which makes them the most meaningful:

  • "0x00908000L" (version 0.9.8)
  • "0x10000000L" (version 1.0.0)
  • "0x10100000L" (version 1.1.0)

for convenience, higher numbers are accepted as well, as long as it's feasible. for example, "0x60000000L" will work as expected. however β€” and listen β€” it's recommended to start using the second form instead. consider this your soft launch into the newer vibe. πŸ’«

  • "mmnnpp" β€” this form is a simple decimal number, calculated with this formula:
major * 10000 + minor * 100 + patch

where major, minor and patch are the desired major, minor and patch components of the version number. examples, because we love a visual:

30000 corresponds to version 3.0.0
10002 corresponds to version 1.0.2
420101 corresponds to version 42.1.1

and if OPENSSL_API_COMPAT is undefined, this default value is used in its place: 30500 ⭐

  • OPENSSL_NO_DEPRECATED β€” if this macro is defined, all deprecated public symbols in all OpenSSL versions up to and including the version given by OPENSSL_API_COMPAT (or the default value given above, when OPENSSL_API_COMPAT isn't defined) will be hidden. poof, gone, blocked. πŸ’€

Copyright 2018-2021 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 in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


okay that's the whole page bestie, go forth and define your macros before your includes πŸ’–

mwah πŸ’‹ β€” this was OpenSSL 3.5.6, dated 2026-04-07, signing off as OPENSSL_USER_MACROS(7ossl). slay! πŸ¦‹

πŸ“¦ where this page comes from