internal/runtime:runtime.cpp
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int llgo_maxprocs()
|
extern "C" {
|
||||||
{
|
|
||||||
|
int llgo_maxprocs() {
|
||||||
#ifdef _SC_NPROCESSORS_ONLN
|
#ifdef _SC_NPROCESSORS_ONLN
|
||||||
return (int)sysconf(_SC_NPROCESSORS_ONLN);
|
return (int)sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
#else
|
#else
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -28,7 +28,7 @@ type _runtime struct{}
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
LLGoPackage = "link"
|
LLGoPackage = "link"
|
||||||
LLGoFiles = "_wrap/runtime.c"
|
LLGoFiles = "_wrap/runtime.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GOROOT returns the root of the Go tree. It uses the
|
// GOROOT returns the root of the Go tree. It uses the
|
||||||
|
|||||||
Reference in New Issue
Block a user