llarp/constants/platform.hpp

Namespaces

Name
llarp
[crypto.hpp]
llarp::platform
namespace for platform feature detection constexprs

Source code

#pragma once

namespace llarp::platform
{
  inline constexpr bool is_linux =
#ifdef __linux__
      true
#else
      false
#endif
      ;

  inline constexpr bool with_systemd =
#ifdef WITH_SYSTEMD
      true
#else
      false
#endif
      ;

  inline constexpr bool is_freebsd =
#ifdef __FreeBSD__
      true
#else
      false
#endif
      ;

  inline constexpr bool is_android =
#ifdef ANDROID
      true
#else
      false
#endif
      ;

  inline constexpr bool is_simulation =
#ifdef LOKINET_HIVE
      true
#else
      false
#endif
      ;
  // on cross compiles sometimes weird permutations of target and host make this value not correct,
  // this ensures it always is
  inline constexpr bool has_systemd = is_linux and with_systemd and not(is_android);

  inline constexpr bool is_mobile = is_android;

  inline constexpr bool supports_ipv6 = true;
}  // namespace llarp::platform

Updated on 2026-01-10 at 22:49:45 +0000