build: COMP_XXX renamed to UNITS_COMP_XXX

This commit is contained in:
Mateusz Pusz committed 2021-03-15 21:13:21 +01:00
1 parent 625f452daa
commit 5c94a40906
12 files changed
+30 -30

No files matched your search

@@ -144,11 +144,11 @@ static_assert(QuantityValue<min_expl<>>);
static_assert(!QuantityValue<min_expl<1>>);
static_assert(!QuantityValue<min_expl<2>>);
static_assert(!QuantityValue<min_expl<3>>);
#if !defined(COMP_GCC) || COMP_GCC > 10 || COMP_GCC_MINOR > 1
#if !defined(UNITS_COMP_GCC) || UNITS_COMP_GCC > 10 || UNITS_COMP_GCC_MINOR > 1
static_assert(!QuantityValue<min_expl<4>>);
#endif
static_assert(!QuantityValue<min_expl<5>>);
#if !defined(COMP_GCC) || COMP_GCC > 10 || COMP_GCC_MINOR > 1
#if !defined(UNITS_COMP_GCC) || UNITS_COMP_GCC > 10 || UNITS_COMP_GCC_MINOR > 1
static_assert(!QuantityValue<min_expl<6>>);
#endif
static_assert(!QuantityValue<min_expl<7>>);
+2 -2
View File
@@ -176,7 +176,7 @@ static_assert(width<metre, double>::max().common().count() == std::numeric_limit
////////////////////////
// default initialization
#if !defined(COMP_MSVC)
#if !defined(UNITS_COMP_MSVC)
static_assert([] {
const auto read_uninitialized_quantity = [] {
width<metre> w;
@@ -367,7 +367,7 @@ static_assert(!std::is_assignable_v<width<metre, int>, width<millimetre, int>>);
// member operators
/////////////////////
#if !defined(COMP_MSVC) || defined(NDEBUG)
#if !defined(UNITS_COMP_MSVC) || defined(NDEBUG)
static_assert([]() {
width<metre, int> w(1 * m);
assert(+w.common() == 1 * m);
@@ -188,7 +188,7 @@ static_assert(abscissa<metre, double>::max().relative().common().count() == std:
////////////////////////
// default initialization
#if !defined(COMP_MSVC)
#if !defined(UNITS_COMP_MSVC)
static_assert([] {
const auto read_uninitialized_quantity = [] {
abscissa<metre> w;
@@ -396,7 +396,7 @@ static_assert(!std::is_assignable_v<abscissa<metre, int>, abscissa<millimetre, i
// member operators
/////////////////////
#if !defined(COMP_MSVC) || defined(NDEBUG)
#if !defined(UNITS_COMP_MSVC) || defined(NDEBUG)
static_assert([]() {
const width<metre, int> w(1 * m);
[[maybe_unused]] quantity_point_kind x(w);
+2 -2
View File
@@ -52,7 +52,7 @@ constexpr auto cgs_cm = cgs::unit_constants::cm;
static_assert(sizeof(length<metre>) == sizeof(double));
static_assert(sizeof(length<metre, short>) == sizeof(short));
#if COMP_GCC != 10 || COMP_GCC_MINOR > 2
#if UNITS_COMP_GCC != 10 || UNITS_COMP_GCC_MINOR > 2
template<template<typename, typename, typename> typename Q>
concept invalid_types = requires {
requires !requires { typename Q<dim_length, second, int>; }; // unit of a different dimension
@@ -303,7 +303,7 @@ static_assert((std::uint8_t(255) * m %= quantity(257)).count() == [] { std::uint
// TODO: Fix
static_assert((std::uint8_t(255) * m %= 257 * m).count() != [] { std::uint8_t ui(255); return ui %= 257; }());
#ifndef COMP_MSVC // TODO ICE (https://developercommunity2.visualstudio.com/t/ICE-on-a-constexpr-operator-in-mp-unit/1302907)
#ifndef UNITS_COMP_MSVC // TODO ICE (https://developercommunity2.visualstudio.com/t/ICE-on-a-constexpr-operator-in-mp-unit/1302907)
// next two lines trigger conversions warnings
// (warning disabled in CMake for this file)
static_assert((22_q_m *= 33.33).count() == 733);
+1 -1
View File
@@ -97,7 +97,7 @@ constexpr T construct_from_only(Us... us) {
return construct_from<T>(us...);
}
#if !defined(COMP_GCC)
#if !defined(UNITS_COMP_GCC)
template<template<typename...> typename T, typename = std::void_t<>, typename... Us>
concept ctad_constructible_from_ = requires(Us... us) { T(us...); };
#else
+2 -2
View File
@@ -32,7 +32,7 @@
#include <cstdint>
#include <type_traits>
#if defined(COMP_MSVC)
#if defined(UNITS_COMP_MSVC)
#pragma warning( disable : 4459 ) // Disable shadowing warning.
#endif
@@ -82,7 +82,7 @@ static_assert(is_same_v<decltype(120.L * km / 2 / h), decltype(60._q_km_per_h)>)
static_assert(1. / 4 * m2 == 1._q_m2 / 4);
#if !defined(COMP_CLANG) // -Wshadow
#if !defined(UNITS_COMP_CLANG) // -Wshadow
static_assert([] {
Speed auto v0 = 10 * m / s;
signed s = 2; // hides ^
+2 -2
View File
@@ -43,7 +43,7 @@ struct dim_time : base_dimension<"time", second> {};
struct kelvin : named_unit<kelvin, "K", no_prefix> {};
#if !COMP_MSVC
#if !UNITS_COMP_MSVC
static_assert([]<Prefix P>(P) { return !requires { typename prefixed_unit<struct kilokelvin, P, kelvin>; }; }(si::kilo{})); // no prefix allowed
#endif
@@ -59,7 +59,7 @@ static_assert(compare<downcast<scaled_unit<ratio(yard::ratio.num, yard::ratio.de
static_assert(compare<downcast<scaled_unit<yard::ratio * ratio(1, 3), metre>>, foot>);
static_assert(compare<downcast<scaled_unit<kilometre::ratio / hour::ratio, metre_per_second>>, kilometre_per_hour>);
#if !COMP_MSVC
#if !UNITS_COMP_MSVC
static_assert([]<ratio R>() { return !requires { typename scaled_unit<R, metre>; }; }.template operator()<ratio(-1, 1)>()); // negative unit ratio
#endif