Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Build
run: go build -v ./...
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# lib
LLGo Standard Libraries
=====

[![Build Status](https://github.com/goplus/lib/actions/workflows/go.yml/badge.svg)](https://github.com/goplus/lib/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/goplus/lib)](https://goreportcard.com/report/github.com/goplus/lib)
[![GitHub release](https://img.shields.io/github/v/tag/goplus/lib.svg?label=release)](https://github.com/goplus/lib/releases)
[![GoDoc](https://pkg.go.dev/badge/github.com/goplus/lib.svg)](https://pkg.go.dev/github.com/goplus/lib)
<!--
[![Coverage Status](https://codecov.io/gh/goplus/lib/branch/main/graph/badge.svg)](https://codecov.io/gh/goplus/lib)
-->
6 changes: 6 additions & 0 deletions c/bdwgc/bdwgc.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ func Realloc(ptr c.Pointer, size uintptr) c.Pointer
//go:linkname Free C.GC_free
func Free(ptr c.Pointer)

//go:linkname AddRoots C.GC_add_roots
func AddRoots(start, end c.Pointer)

//go:linkname RemoveRoots C.GC_remove_roots
func RemoveRoots(start, end c.Pointer)

// -----------------------------------------------------------------------------

//go:linkname RegisterFinalizer C.GC_register_finalizer
Expand Down
26 changes: 11 additions & 15 deletions c/c.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@

package c

// typedef unsigned int uint;
// typedef unsigned long ulong;
// typedef unsigned long long ulonglong;
// typedef long long longlong;
import "C"
import "unsafe"
import (
"unsafe"
)

const (
LLGoPackage = "decl"
Expand All @@ -41,14 +38,16 @@ type FILE struct {
}

type (
Int C.int
Uint C.uint
Int = int32
Uint = uint32

Long C.long
Ulong C.ulong
// Long and Ulong are defined in platform-specific files
// Windows (both 32-bit and 64-bit): int32/uint32
// Unix/Linux/macOS 32-bit: int32/uint32
// Unix/Linux/macOS 64-bit: int64/uint64

LongLong C.longlong
UlongLong C.ulonglong
LongLong = int64
UlongLong = uint64
)

type integer interface {
Expand Down Expand Up @@ -308,6 +307,3 @@ func GetoptLong(argc Int, argv **Char, optstring *Char, longopts *Option, longin
func GetoptLongOnly(argc Int, argv **Char, optstring *Char, longopts *Option, longindex *Int) Int

// -----------------------------------------------------------------------------

//go:linkname Sysconf C.sysconf
func Sysconf(name Int) Long
224 changes: 0 additions & 224 deletions c/clang/_wrap/cursor.cpp

This file was deleted.

7 changes: 0 additions & 7 deletions c/clang/_wrap/llgo_check.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions c/clang/_wrap/llgo_check.go

This file was deleted.

Loading
Loading