diff --git a/runtime/internal/lib/runtime/_wrap/runtime.c b/runtime/internal/lib/runtime/_wrap/runtime.cpp similarity index 77% rename from runtime/internal/lib/runtime/_wrap/runtime.c rename to runtime/internal/lib/runtime/_wrap/runtime.cpp index 4dc23cfd..f97d91bd 100644 --- a/runtime/internal/lib/runtime/_wrap/runtime.c +++ b/runtime/internal/lib/runtime/_wrap/runtime.cpp @@ -1,10 +1,12 @@ #include -int llgo_maxprocs() -{ +extern "C" { + +int llgo_maxprocs() { #ifdef _SC_NPROCESSORS_ONLN return (int)sysconf(_SC_NPROCESSORS_ONLN); #else return 1; #endif } +} \ No newline at end of file diff --git a/runtime/internal/lib/runtime/runtime.go b/runtime/internal/lib/runtime/runtime.go index 398d248a..116bcc48 100644 --- a/runtime/internal/lib/runtime/runtime.go +++ b/runtime/internal/lib/runtime/runtime.go @@ -28,7 +28,7 @@ type _runtime struct{} const ( LLGoPackage = "link" - LLGoFiles = "_wrap/runtime.c" + LLGoFiles = "_wrap/runtime.cpp" ) // GOROOT returns the root of the Go tree. It uses the