internal/build:compile with c mode,when c file
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
void llgo_getcpuid(unsigned int eax, unsigned int ecx,
|
||||
unsigned int *a, unsigned int *b,
|
||||
@@ -22,5 +19,3 @@ void llgo_getcpuid(unsigned int eax, unsigned int ecx,
|
||||
#else
|
||||
#error This code requires GCC or Clang
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_wrap/cpu_x86.cpp"
|
||||
LLGoFiles = "_wrap/cpu_x86.c"
|
||||
)
|
||||
|
||||
//go:linkname c_getcpuid C.llgo_getcpuid
|
||||
|
||||
@@ -9,8 +9,6 @@ struct fcntl_ret
|
||||
int32_t err; // Error code
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
// llgo_fcntl implements the fcntl system call wrapper for Go
|
||||
// fd: file descriptor
|
||||
// cmd: fcntl command
|
||||
@@ -32,6 +30,4 @@ struct fcntl_ret llgo_fcntl2(int32_t fd, int32_t cmd, int32_t arg)
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
// llgo:skip fcntl
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_unix/fcntl_unix.cpp"
|
||||
LLGoFiles = "_unix/fcntl_unix.c"
|
||||
)
|
||||
|
||||
//go:linkname llgo_fcntl2 C.llgo_fcntl2
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
int llgo_maxprocs()
|
||||
{
|
||||
#ifdef _SC_NPROCESSORS_ONLN
|
||||
@@ -10,5 +8,3 @@ int llgo_maxprocs()
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ type _runtime struct{}
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_wrap/runtime.cpp"
|
||||
LLGoFiles = "_wrap/runtime.c"
|
||||
)
|
||||
|
||||
// GOROOT returns the root of the Go tree. It uses the
|
||||
|
||||
Reference in New Issue
Block a user