diff --git a/runtime/internal/clite/os/_os/os.c b/runtime/internal/clite/os/_os/os.c index 1d904faf..45c2e8e8 100644 --- a/runtime/internal/clite/os/_os/os.c +++ b/runtime/internal/clite/os/_os/os.c @@ -1,12 +1,14 @@ #include #include -int llgoClearenv() { +int cliteClearenv() +{ extern char **environ; - if (environ != NULL) { + if (environ != NULL) + { *environ = NULL; } return 0; } -int llgoErrno() { return errno; } +int cliteErrno() { return errno; } diff --git a/runtime/internal/clite/os/os.go b/runtime/internal/clite/os/os.go index 8d7199ee..fe3bf3a9 100644 --- a/runtime/internal/clite/os/os.go +++ b/runtime/internal/clite/os/os.go @@ -70,7 +70,7 @@ type ( StatT = syscall.Stat_t ) -//go:linkname Errno C.llgoErrno +//go:linkname Errno C.cliteErrno func Errno() c.Int //go:linkname Umask C.umask diff --git a/runtime/internal/clite/os/os_other.go b/runtime/internal/clite/os/os_other.go index ae78cd41..5f489058 100644 --- a/runtime/internal/clite/os/os_other.go +++ b/runtime/internal/clite/os/os_other.go @@ -25,5 +25,5 @@ const ( LLGoPackage = "link" ) -//go:linkname Clearenv C.llgoClearenv +//go:linkname Clearenv C.cliteClearenv func Clearenv() diff --git a/runtime/internal/clite/pthread/sync/_wrap/pthd.c b/runtime/internal/clite/pthread/sync/_wrap/pthd.c index f7bc7eb9..0ba77d69 100644 --- a/runtime/internal/clite/pthread/sync/_wrap/pthd.c +++ b/runtime/internal/clite/pthread/sync/_wrap/pthd.c @@ -2,17 +2,19 @@ // ----------------------------------------------------------------------------- -pthread_once_t llgoSyncOnceInitVal = PTHREAD_ONCE_INIT; +pthread_once_t cliteSyncOnceInitVal = PTHREAD_ONCE_INIT; // ----------------------------------------------------------------------------- // wrap return type to void -void wrap_pthread_mutex_lock(pthread_mutex_t *mutex) { +void clite_wrap_pthread_mutex_lock(pthread_mutex_t *mutex) +{ pthread_mutex_lock(mutex); } // wrap return type to void -void wrap_pthread_mutex_unlock(pthread_mutex_t *mutex) { +void clite_wrap_pthread_mutex_unlock(pthread_mutex_t *mutex) +{ pthread_mutex_unlock(mutex); } diff --git a/runtime/internal/clite/pthread/sync/sync.go b/runtime/internal/clite/pthread/sync/sync.go index b841d2ac..ececfd75 100644 --- a/runtime/internal/clite/pthread/sync/sync.go +++ b/runtime/internal/clite/pthread/sync/sync.go @@ -36,7 +36,7 @@ const ( // Once is an object that will perform exactly one action. type Once C.pthread_once_t -//go:linkname OnceInit llgoSyncOnceInitVal +//go:linkname OnceInit cliteSyncOnceInitVal var OnceInit Once // llgo:link (*Once).Do C.pthread_once @@ -79,10 +79,10 @@ func (m *Mutex) Destroy() {} // llgo:link (*Mutex).TryLock C.pthread_mutex_trylock func (m *Mutex) TryLock() c.Int { return 0 } -// llgo:link (*Mutex).Lock C.wrap_pthread_mutex_lock +// llgo:link (*Mutex).Lock C.clite_wrap_pthread_mutex_lock func (m *Mutex) Lock() {} -// llgo:link (*Mutex).Unlock C.wrap_pthread_mutex_unlock +// llgo:link (*Mutex).Unlock C.clite_wrap_pthread_mutex_unlock func (m *Mutex) Unlock() {} // -----------------------------------------------------------------------------