internal/build:compile with c mode,when c file
This commit is contained in:
@@ -6,8 +6,6 @@ typedef union
|
||||
long long ll;
|
||||
} castUnion;
|
||||
|
||||
extern "C" {
|
||||
|
||||
double llgoToFloat64(long long v)
|
||||
{
|
||||
castUnion k;
|
||||
@@ -35,5 +33,3 @@ int llgoFromFloat32(float v)
|
||||
k.f = v;
|
||||
return k.v;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ package bitcast
|
||||
import _ "unsafe"
|
||||
|
||||
const (
|
||||
LLGoFiles = "_cast/cast.cpp"
|
||||
LLGoFiles = "_cast/cast.c"
|
||||
LLGoPackage = "link"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include <dlfcn.h>
|
||||
#include <libunwind.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void *llgo_address() {
|
||||
return __builtin_return_address(0);
|
||||
}
|
||||
@@ -40,6 +38,4 @@ void llgo_stacktrace(int skip, void *ctx, int (*fn)(void *ctx, void *pc, void *o
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
LLGoFiles = "$(llvm-config --cflags): _wrap/debug.cpp"
|
||||
LLGoFiles = "$(llvm-config --cflags): _wrap/debug.c"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include <ffi.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void *llog_ffi_closure_alloc(void **code) {
|
||||
return ffi_closure_alloc(sizeof(ffi_closure), code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
const (
|
||||
LLGoPackage = "link: $(pkg-config --libs libffi); -lffi"
|
||||
LLGoFiles = "$(pkg-config --cflags libffi): _wrap/libffi.cpp"
|
||||
LLGoFiles = "$(pkg-config --cflags libffi): _wrap/libffi.c"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include <uv.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
int uv_tcp_get_io_watcher_fd (uv_tcp_t* handle) {
|
||||
return handle->io_watcher.fd;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
const (
|
||||
LLGoPackage = "link: $(pkg-config --libs libuv); -luv"
|
||||
LLGoFiles = "$(pkg-config --cflags libuv): _wrap/libuv.cpp"
|
||||
LLGoFiles = "$(pkg-config --cflags libuv): _wrap/libuv.c"
|
||||
)
|
||||
|
||||
// ----------------------------------------------
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void opensslFree(void *ptr) {
|
||||
OPENSSL_free(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const (
|
||||
LLGoFiles = "$(pkg-config --cflags openssl): _wrap/openssl.cpp"
|
||||
LLGoFiles = "$(pkg-config --cflags openssl): _wrap/openssl.c"
|
||||
LLGoPackage = "link: $(pkg-config --libs openssl); -lssl -lcrypto"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
int cliteClearenv()
|
||||
{
|
||||
extern char **environ;
|
||||
@@ -14,5 +12,3 @@ int cliteClearenv()
|
||||
}
|
||||
|
||||
int cliteErrno() { return errno; }
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
LLGoFiles = "_os/os.cpp"
|
||||
LLGoFiles = "_os/os.c"
|
||||
LLGoPackage = "link"
|
||||
)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
LLGoFiles = "_os/os.cpp"
|
||||
LLGoFiles = "_os/os.c"
|
||||
LLGoPackage = "link"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user