diff --git a/flang-rt/lib/runtime/CMakeLists.txt b/flang-rt/lib/runtime/CMakeLists.txt index c5e7bdce5b2fd..c5ea312d11c89 100644 --- a/flang-rt/lib/runtime/CMakeLists.txt +++ b/flang-rt/lib/runtime/CMakeLists.txt @@ -23,6 +23,7 @@ set(supported_sources assign.cpp buffer.cpp character.cpp + complex-powi.cpp connection.cpp copy.cpp derived-api.cpp diff --git a/flang-rt/lib/runtime/complex-powi.cpp b/flang-rt/lib/runtime/complex-powi.cpp index a561d114591cf..bc33072573730 100644 --- a/flang-rt/lib/runtime/complex-powi.cpp +++ b/flang-rt/lib/runtime/complex-powi.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "flang/Common/api-attrs.h" #include "flang/Common/float128.h" #include "flang/Runtime/cpp-type.h" #include "flang/Runtime/entry-names.h" @@ -18,7 +19,7 @@ namespace Fortran::runtime { #pragma clang diagnostic ignored "-Wc99-extensions" #endif -template C tgpowi(C base, I exp) { +template inline RT_API_ATTRS C tgpowi(C base, I exp) { if (exp == 0) { return C{1}; } @@ -65,21 +66,23 @@ template C tgpowi(C base, I exp) { #ifndef _MSC_VER // With most compilers, C complex is implemented as a builtin type that may have // specific ABI requirements -extern "C" float _Complex RTNAME(cpowi)(float _Complex base, std::int32_t exp) { +extern "C" RT_API_ATTRS CppTypeFor RTNAME(cpowi)( + CppTypeFor base, std::int32_t exp) { return tgpowi(base, exp); } -extern "C" double _Complex RTNAME(zpowi)( - double _Complex base, std::int32_t exp) { +extern "C" RT_API_ATTRS CppTypeFor RTNAME(zpowi)( + CppTypeFor base, std::int32_t exp) { return tgpowi(base, exp); } -extern "C" float _Complex RTNAME(cpowk)(float _Complex base, std::int64_t exp) { +extern "C" RT_API_ATTRS CppTypeFor RTNAME(cpowk)( + CppTypeFor base, std::int64_t exp) { return tgpowi(base, exp); } -extern "C" double _Complex RTNAME(zpowk)( - double _Complex base, std::int64_t exp) { +extern "C" RT_API_ATTRS CppTypeFor RTNAME(zpowk)( + CppTypeFor base, std::int64_t exp) { return tgpowi(base, exp); }