diff --git a/xo-expression/example/ex1/ex1.cpp b/xo-expression/example/ex1/ex1.cpp index 5dd91fe2..0c69cab4 100644 --- a/xo-expression/example/ex1/ex1.cpp +++ b/xo-expression/example/ex1/ex1.cpp @@ -5,6 +5,14 @@ #include "xo/expression/llvmintrinsic.hpp" #include #include +#include + +// address of &sqrt ambiguous on osx/clang +// (perhaps it's a template..?) +// +double xo_sqrt(double x) { + return sqrt(x); +} int main() { @@ -20,7 +28,7 @@ main() { { auto expr = make_primitive("sqrt", - &::sqrt, + &xo_sqrt, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sqrt); diff --git a/xo-jit/example/ex1/ex1.cpp b/xo-jit/example/ex1/ex1.cpp index 22e1b0b7..638e1bda 100644 --- a/xo-jit/example/ex1/ex1.cpp +++ b/xo-jit/example/ex1/ex1.cpp @@ -29,8 +29,28 @@ #include "llvm/Transforms/Scalar/GVN.h" #include "llvm/Transforms/Scalar/Reassociate.h" #include "llvm/Transforms/Scalar/SimplifyCFG.h" +#include -//double foo(double x) { return x; } +namespace { + // need wrappers to fix type signature for osx/clang15. Perhaps sqrt() is a macro or template (?) + double + xo_sqrt(double x) + { + return ::sqrt(x); + } + + double + xo_sin(double x) + { + return ::sin(x); + } + + double + xo_cos(double x) + { + return ::cos(x); + } +} int main() { @@ -82,7 +102,7 @@ main() { } { - auto expr = make_primitive("sqrt", &sqrt, + auto expr = make_primitive("sqrt", &xo_sqrt, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sqrt); @@ -105,7 +125,7 @@ main() { { /* (sqrt 2) */ - auto fn = make_primitive("sqrt", &sqrt, + auto fn = make_primitive("sqrt", &xo_sqrt, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sqrt); auto arg = make_constant(2.0); @@ -132,11 +152,11 @@ main() { /* (lambda (x) (sin (cos x))) */ auto sin = make_primitive("sin", - ::sin, + &xo_sin, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sin); auto cos = make_primitive("cos", - ::cos, + &xo_cos, false /*!explicit_symbol_def*/, llvmintrinsic::fp_cos); diff --git a/xo-jit/example/ex2_jit/ex2_jit.cpp b/xo-jit/example/ex2_jit/ex2_jit.cpp index 3131f823..b21d5e41 100644 --- a/xo-jit/example/ex2_jit/ex2_jit.cpp +++ b/xo-jit/example/ex2_jit/ex2_jit.cpp @@ -33,6 +33,15 @@ //double foo(double x) { return x; } +namespace { + // need wrappers to pin type signature for osx/clang15 + double + xo_sqrt(double x) + { + return ::sqrt(x); + } +} + int main() { using xo::scope; @@ -68,7 +77,7 @@ main() { { auto sqrt = make_primitive("sqrt", - ::sqrt, + &xo_sqrt, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sqrt); @@ -115,7 +124,7 @@ main() { #elif CHOICE == 2 #define FUNCTION_SYMBOL "twice" auto root = make_primitive("sqrt", - ::sqrt, + &xo_sqrt, false /*!explicit_symbol_def*/, llvmintrinsic::fp_sqrt); diff --git a/xo-reader/src/reader/exprseq_xs.cpp b/xo-reader/src/reader/exprseq_xs.cpp index b934c2ef..421b037c 100644 --- a/xo-reader/src/reader/exprseq_xs.cpp +++ b/xo-reader/src/reader/exprseq_xs.cpp @@ -66,8 +66,6 @@ namespace xo { { /* toplevel expression sequence accepts an * arbitrary number of expressions. - * - * parser::include_token() returns */ auto p_emit_expr = p_psm->p_emit_expr_; diff --git a/xo-unit/include/xo/unit/dimension.hpp b/xo-unit/include/xo/unit/dimension.hpp index c28936e2..c926455b 100644 --- a/xo-unit/include/xo/unit/dimension.hpp +++ b/xo-unit/include/xo/unit/dimension.hpp @@ -2,6 +2,9 @@ #pragma once +#ifdef __APPL__ +# include // for std::size_t when building with clang18 +#endif #include namespace xo { @@ -58,7 +61,7 @@ namespace xo { } /** @brief number of built-in dimensions, convenient for array sizing **/ - static constexpr std::size_t n_dim = static_cast(dimension::n_dim); + static constexpr std::uint64_t n_dim = static_cast(dimension::n_dim); } /*namespace qty*/ } /*namespace xo*/