Skip to content

Commit

Permalink
Merge pull request #1453 from evoskuil/master
Browse files Browse the repository at this point in the history
Add and organize defines.
  • Loading branch information
evoskuil authored May 22, 2024
2 parents c087f4f + 4564d8d commit 0b75d57
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions include/bitcoin/system/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,7 @@ namespace bc = libbitcoin;
#define BC_DEBUG_ONLY(expression) expression
#endif

/// Bitness.
/// ---------------------------------------------------------------------------

#if defined(HAVE_X32)
namespace libbitcoin { constexpr auto build_x32 = true; };
#else
namespace libbitcoin { constexpr auto build_x32 = false; };
#endif
#if defined(HAVE_X64)
namespace libbitcoin { constexpr auto build_x64 = true; };
#else
namespace libbitcoin { constexpr auto build_x64 = false; };
#endif

/// Attributes.
/// Messages.
/// ---------------------------------------------------------------------------

/// Emit messages from .cpp during compilation.
Expand All @@ -103,6 +89,9 @@ namespace bc = libbitcoin;
#define DEFINED(text)
#endif

/// Symbols.
/// ---------------------------------------------------------------------------

/// See gcc.gnu.org/wiki/Visibility
/// Generic helper definitions for shared library support
/// GNU visibilty attribute overrides compiler flag `fvisibility`.
Expand Down Expand Up @@ -135,6 +124,9 @@ namespace bc = libbitcoin;
#define BC_INTERNAL BC_HELPER_DLL_LOCAL
#endif

/// Inlines.
/// ---------------------------------------------------------------------------

/// A stronger compiler hint for inlining.
/// May use prior to 'constexpr' or in place of 'inline'.
/// Do not use in conjunction with with XCONSTEXPR macros, as this will result
Expand All @@ -148,7 +140,34 @@ namespace bc = libbitcoin;
#define INLINE inline
#endif

/// Class helpers
/// Major platform.
/// ---------------------------------------------------------------------------

#if defined(HAVE_X32)
namespace libbitcoin { constexpr auto build_x32 = true; };
#else
namespace libbitcoin { constexpr auto build_x32 = false; };
#endif

#if defined(HAVE_X64)
namespace libbitcoin { constexpr auto build_x64 = true; };
#else
namespace libbitcoin { constexpr auto build_x64 = false; };
#endif

#ifdef HAVE_XCPU
namespace libbitcoin { constexpr auto with_xcpu = true; };
#else
namespace libbitcoin { constexpr auto with_xcpu = false; };
#endif

#ifdef HAVE_ARM
namespace libbitcoin { constexpr auto with_arm = true; };
#else
namespace libbitcoin { constexpr auto with_arm = false; };
#endif

/// Class helpers.
/// ---------------------------------------------------------------------------
/// Virtual concrete classes should define public virtual destructor.
/// Abstract base classes may define protected non-virtual destructor.
Expand Down Expand Up @@ -187,7 +206,7 @@ namespace bc = libbitcoin;
DEFAULT_COPY_MOVE(name); \
virtual ~name() = default

/// Minimums
/// Minimums.
/// ---------------------------------------------------------------------------

#if !defined(HAVE_CPP20)
Expand Down

0 comments on commit 0b75d57

Please sign in to comment.