feat: freestanding support added

Resolves #564, #565, and #556
This commit is contained in:
Mateusz Pusz
2024-05-30 19:50:02 +02:00
parent c151740a43
commit cd36e6f974
30 changed files with 387 additions and 60 deletions
+3 -1
View File
@@ -20,7 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#if MP_UNITS_HOSTED
#include <mp-units/math.h> // IWYU pragma: keep
#endif
#include <mp-units/systems/iau.h>
#include <mp-units/systems/isq/space_and_time.h>
#include <mp-units/systems/si.h>
@@ -42,7 +44,7 @@ static_assert(isq::length(1 * LD) == 384'399 * si::kilo<si::metre>);
static_assert(isq::length(1 * ly) == 9'460'730'472'580'800 * si::metre);
static_assert(isq::length(10'000'000'000 * A) == 1 * si::metre);
#if __cpp_lib_constexpr_cmath || MP_UNITS_COMP_GCC
#if MP_UNITS_HOSTED && (__cpp_lib_constexpr_cmath || MP_UNITS_COMP_GCC)
// TODO Should the below work for `1 * pc`? If yes, how to extent the type and how to convert it to a floating-point
// representation for comparison purposes?
static_assert(round<si::metre>(isq::length(1.L * pc)) == 30'856'775'814'913'673 * si::metre);