internal/runtime:runtime.cpp

This commit is contained in:
luoliwoshang
2025-06-11 19:02:58 +08:00
parent 9c66cb9b00
commit 0cb29ab388
2 changed files with 5 additions and 3 deletions

View File

@@ -1,10 +1,12 @@
#include <unistd.h>
int llgo_maxprocs()
{
extern "C" {
int llgo_maxprocs() {
#ifdef _SC_NPROCESSORS_ONLN
return (int)sysconf(_SC_NPROCESSORS_ONLN);
#else
return 1;
#endif
}
}

View File

@@ -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