Releases: goplus/llcppg
v0.7.7
Current llcppg is compiled by llgov0.12.0
What's Changed
- ci: limit action concurrecy numbers by @MeteorsLiu in #574
- build(deps): bump github.com/goplus/gogen from 1.19.2 to 1.19.3 by @dependabot[bot] in #575
- build(deps): bump github.com/goplus/gogen from 1.19.3 to 1.19.5 by @dependabot[bot] in #578
- docs: add CLAUDE.md AI assistant guide by @xgopilot[bot] in #577
- ci: remove unnecessary Python setup from macOS CI by @luoliwoshang in #584
- build(deps): bump github.com/goplus/lib from 0.3.0 to 0.3.1 by @xgopilot[bot] in #587
- build(deps): bump actions/checkout from 5 to 6 by @dependabot[bot] in #591
- demo:update to libxml2v2.15 use by @luoliwoshang in #602
- ci: exclude bot branches from push event triggers by @xgopilot[bot] in #605
- build(deps): bump github.com/goplus/mod from 0.17.1 to 0.18.0 by @dependabot[bot] in #608
- deps: update to llgo v0.12.0 and related dependencies by @xgopilot[bot] in #606
- feat: use prebuilt llgo v0.12.0 and keep LLVM for clang by @xgopilot[bot] in #610
- chore: update llcppg to generate go.mod with goplus/lib v0.3.1 by @xgopilot[bot] in #612
New Contributors
Full Changelog: v0.7.6...v0.7.7
v0.7.6
What's Changed
feat
- feat: support nested enum by @MeteorsLiu in #528
update
- internal/clang:remove wrap by @luoliwoshang in #564
ci
deps
- build(deps): bump actions/checkout from 4 to 5 by @dependabot[bot] in #543
- build(deps): bump github.com/goplus/gogen from 1.19.0 to 1.19.1 by @dependabot[bot] in #546
- deps:update llgo to e4218f9 by @luoliwoshang in #563
- build(deps): bump github.com/goplus/lib from 0.2.0 to 0.3.0 by @dependabot[bot] in #566
- build(deps): bump github.com/goplus/lib from 0.2.0 to 0.3.0 by @dependabot[bot] in #566
- build(deps): bump github.com/goplus/gogen from 1.19.1 to 1.19.2 by @dependabot[bot] in #567
docs
- docs: standardize C/C++ language names to uppercase in documentation and code comments by @Copilot in #537
- Add comprehensive GitHub Copilot instructions for llcppg development by @Copilot in #533
- docs: replace lowercase "go" and "llgo" with "Go" and "LLGo" in documentation by @Copilot in #539
- Fix JSON field name in README.md: change 'includes' to 'include' by @luoliwoshang in #550
- docs: Fix typos in documentation and code comments by @luoliwoshang in #551
- docs: wrap config file names with backticks in markdown by @luoliwoshang in #545
- Fix punctuation spacing in Go code comments by @luoliwoshang in #554
- Fix punctuation spacing in English documentation by @luoliwoshang in #553
- docs: add nested enum by @MeteorsLiu in #530
- 实现 Issue #568: docs:find typo & fix it by @niupilot[bot] in #570
New Contributors
- @Copilot made their first contribution in #537
- @niupilot[bot] made their first contribution in #570
- @aofei made their first contribution in #573
Full Changelog: v0.7.5...v0.7.6
v0.7.5
What's Changed
parser
- fix(parser): anonymous struct behavior when
isCppis false by @MeteorsLiu in #524 - feat:distinguish forwarddecl & empty decl by @luoliwoshang in #527
change
- chore:move from goplus/lib/c/clang by @luoliwoshang in #529
Full Changelog: v0.7.4...v0.7.5
v0.7.4
What's Changed
- chore(style): refine some error name by @luoliwoshang in #518
- fix(llcppsymg):avoid ignore flag process overload by @luoliwoshang in #523
Full Changelog: v0.7.3...v0.7.4
v0.7.3
What's Changed
doc
- docs(design): add named nested struct handling design by @luoliwoshang in #515
parser
- feat(parser): nested struct/union decl by @luoliwoshang in #516
Full Changelog: v0.7.2...v0.7.3
Nested Struct
Anonymous Nested Struct
Anonymous nested structs/unions are converted to inline Go struct types within the parent struct.
struct outer {
struct {
int x;
int y;
} inner;
};type Outer struct {
Inner struct {
X c.Int
Y c.Int
}
}Named Nested Struct
Named nested structs in C are accessible in the global scope, not just as anonymous nested types. llcppg handles this by creating separate type declarations for both the outer and inner structs.
Reason: In C, named nested structs are declared in the global scope and can be used independently. This means struct inner_struct can be used anywhere in the code, not just within the context of the outer struct.
typedef struct struct2 {
char *b;
struct inner_struct {
long l;
} init;
} struct2;
// This is valid C - inner_struct is in global scope
struct inner_struct inner = {123};Generated Go code:
type InnerStruct struct {
L c.Long
}
type Struct2 struct {
B *c.Char
Init InnerStruct
}This is equivalent to:
struct inner_struct {
long l;
};
struct struct2 {
char *b;
struct inner_struct init;
};v0.7.2
What's Changed
llcppsymg
- fix(llcppsymg): skip generating variadic function as a receiver method by @MeteorsLiu in #513
cl
- cl:avoid c function with valist to method by @luoliwoshang in #512
change
- refactor(pkghfileinfo): replace libclang with clang for pkghfile by @MeteorsLiu in #509
docs
- docs(design):function with va list should not have receiver by @luoliwoshang in #511
To Method
When a C function could be a Go method, llcppg automatically converts the function to a Go method, moving the first parameter to the receiver position, and using recv_ as the receiver name.
Since Go's //go:linkname directive doesn't support methods, llgo uses // llgo:link to mark the connection between methods and C symbols.And generated methods return zero values of their return types as placeholders.
And LLGo should not treat C functions with variable parameters as methods. Variadic functions (those using ... in their parameter list) will be generated as regular Go functions rather than methods, even if they otherwise meet the criteria for method conversion.
Full Changelog: v0.7.1...v0.7.2
v0.7.1
What's Changed
llcppsymg
- feat(llcppsymg): filter static function for AST scanning by @MeteorsLiu in #488
- feat(llcppsymg): support header-only mode by @MeteorsLiu in #492
parser
- internal/parser:parse unexpose type by @luoliwoshang in #506
cl
- refactor(cl):allow empty lib command by @luoliwoshang in #491
docs
- docs: trim whitespace by @MeteorsLiu in #490
- docs(design): add
headerOnlyby @MeteorsLiu in #489 - docs(README): trim whitespace by @MeteorsLiu in #495
- docs(README): add header-only readme by @MeteorsLiu in #496
- docs(design): fix header-only title level by @MeteorsLiu in #500
test
- test(llcppsymg): replace test logics with source func by @MeteorsLiu in #493
Full Changelog: v0.7.0...v0.7.1
Usage
The configuration file supports the following options:
name: The name of the generated packagecflags: Compiler flags for the C/C++ libraryinclude: Header files to include in the binding generationlibs: Library flags for linkingtrimPrefixes: Prefixes to remove from function names & type namescplusplus: Set to true for C++ libraries(not support)deps: Dependencies (other packages & standard libraries)mix: Set to true when package header files are mixed with other header files in the same directory. In this mode, only files explicitly listed inincludeare processed as package files.typeMap: Custom name mapping from C types to Go types.symMap: Custom name mapping from C function names to Go function names.staticLib: Set to true to enable static library symbol reading instead of dynamic library linking. When enabled, llcppg will read symbols from static libraries (.a files) rather than dynamic libraries (.so/.dylib files).headerOnly: Set to true to enable header-only mode. In header-only processing mode, instead of matching library symbols with header declarations, it will generate the symbol table based solely on header files specified in cflags.
v0.7.0
What's Changed
llcppsymg
- llcppsymg:static lib mode by @luoliwoshang in #478
- fix(llcppsymg): clean path for presumed location by @MeteorsLiu in #485
parser
- internal/parser:ast.Object with filepath.Clean by @luoliwoshang in #481
llcppcfg
- feat(llcppcfg): omit optional fields empty by @MeteorsLiu in #465
ci/test
- ci: upgrade llgo by @MeteorsLiu in #466
- ci: upgrade llgo for llgo test ./... by @MeteorsLiu in #471
- ci(llgotest):remove complete comment by @luoliwoshang in #472
- feat: copy demos to tmp dir by @MeteorsLiu in #482
- test(llcppsymg):test fetch symbol with actual symbol file by @luoliwoshang in #476
docs
- docs: add llcppcfg design by @MeteorsLiu in #467
- docs(design):why cross-platform handing by @luoliwoshang in #470
- docs(design):staticLib by @luoliwoshang in #484
- docs(readme):staticLib by @luoliwoshang in #486
changes
- feat(hfile):platform file determine interface by @luoliwoshang in #469
- chore:test case name of llcppsymg by @luoliwoshang in #487
Full Changelog: v0.6.0...v0.6.1
Static Library Support
When staticLib: true is configured in llcppg.cfg, llcppsymg switches to static library mode:
- Dynamic Library Mode (default): Uses nm tool to extract symbols from .so/.dylib files
- Static Library Mode: Uses nm tool to extract symbols from .a files
v0.6.0
What's Changed
llcppsigfetch
- refactor(llcppsigfetch):reuse llgo/preprocessor by @luoliwoshang in #426
- chore: rename internal/config to internal/header by @MeteorsLiu in #430
llcppsymg
- feat(symbol):fetch symbol with llvm-nm by @luoliwoshang in #389
- feat(symg):avoid list not global symbol by @luoliwoshang in #414
- refactor(llcppsymg):ignore unnessary error path check by @luoliwoshang in #422
- refactor(llcppsymg):rm unreach case in method check by @luoliwoshang in #425
- refactor(llcppsymg): isMethod -> beRecv by @luoliwoshang in #424
- refactor(llcppsymg):prepare for static symbol by @luoliwoshang in #432
cl
- feat(cl):implement normal refer func pointer instead c.Pointer by @luoliwoshang in #437
- Revert "feat(gogensig):normal refer func pointer instead (#437)" by @MeteorsLiu in #462
- feat(cl):normal refer func pointer instead by @luoliwoshang in #463
docs
- doc(design):headerfile concept & dependency design by @luoliwoshang in #440
- doc(design):basic name mapping rules by @luoliwoshang in #439
- docs(design):move headerfile example explanation by @luoliwoshang in #443
- docs(design):move cross platform rule by @luoliwoshang in #442
- docs(design):param name by @luoliwoshang in #444
- docs(design):basic type & void * & func pointer map by @luoliwoshang in #445
- docs(design):move usage & step to doc/en/dev by @luoliwoshang in #450
- docs(design):llcppsymg & llcppsigfetch & gogensig by @luoliwoshang in #452
- docs(design):refer named func pointer in struct instead c.Pointer by @luoliwoshang in #446
- docs(design):function map by @luoliwoshang in #458
- docs(readme):add badge to enable auto refresh deepwiki by @luoliwoshang in #451
- readme(xgo):xgo badge by @luoliwoshang in #460
- docs(design):output detail by @luoliwoshang in #461
ci
- ci:test in linux/arm & macos/x86 by @luoliwoshang in #427
- ci: remove brew update by @MeteorsLiu in #435
- ci: move cjson dep by @MeteorsLiu in #464
deps
- build(deps): bump github.com/qiniu/x from 1.15.0 to 1.15.1 by @dependabot in #421
- deps:llgo@fc8664 by @luoliwoshang in #428
- build(deps): bump github.com/goplus/gogen from 1.18.1 to 1.19.0 by @dependabot in #433
- deps(llgo):with clang++ version by @luoliwoshang in #459
test
- test(e2etest):cfg in result dir by @luoliwoshang in #417
- test(e2etest): add llcppcfg end2end test by @MeteorsLiu in #418
- test(e2etest):libxslt depend libxml2 by @luoliwoshang in #419
- test(e2etest): add libtool by @MeteorsLiu in #438
- fix(llcppgtest): seperate temp path for each llgo run by @MeteorsLiu in #447
- fix(llcppgtest): specify GOCACHE by @MeteorsLiu in #454
- test(e2etest): increase timeout by @MeteorsLiu in #457
Full Changelog: v0.5.1...v0.6.0
Function pointer
C function pointer types are converted to Go function types with corresponding parameter and return type mappings,And llgo need to add llgo:type C tag to the function type.
typedef int (*CallBack)(void *L);// llgo:type C
type CallBack func(c.Pointer) c.IntFor function pointer types referenced in function signatures & struct fields, the type is replaced with the converted Go function type.
void exec(void *L, CallBack cb);// llgo:type C
func Exec(L c.Pointer, cb CallBack)typedef struct Stream {
CallBack cb;
} Stream;type Stream struct {
Cb CallBack
}v0.5.1
What's Changed
parser & ast:
- internal/parser:block pointer by @luoliwoshang in #371
- internal/unmarshal:unmarshal null by @luoliwoshang in #373
- refactor(parser): replace cjson with json by @MeteorsLiu in #390
- refactor(sigfetch): replace cjson with json by @MeteorsLiu in #396
llcppsymg:
- refactor(llcppgsymg):write with json instead cjson by @luoliwoshang in #387
- refactor(llcppgsymg/symg):do with params instead llcppg.cfg by @luoliwoshang in #391
- refactor(symg):ld search path | search lib file by @luoliwoshang in #399
- refactor(llcppsymg):rm unnessary temp param for parse by @luoliwoshang in #411
- refactor(llcppsymg):process by single unit by @luoliwoshang in #412
- fix(lackfunc):presumeLocation instead cursorLocation for macroExpan by @luoliwoshang in #402
gogensig & cl:
- llcppg/refine:convert return err by @luoliwoshang in #380
- refactor(config):config/ReadPubFile by @luoliwoshang in #384
- refactor(gogensig/conf):rm useless public fn by @luoliwoshang in #385
- refactor(config):avoid reduant symbol table by @luoliwoshang in #386
e2e test:
- test:end2end compare test by @luoliwoshang in #392
- test(end2end):demo test by @luoliwoshang in #394
- test(e2etest):log2file & test parallel by @luoliwoshang in #400
- test(e2etest):sqlite3/3.49.1 by @luoliwoshang in #403
- test(e2etest):zlib by @luoliwoshang in #404
- test(e2etest):cargs by @luoliwoshang in #405
- test(e2etest):bzip3 by @luoliwoshang in #406
- test(e2etest):bzip2 by @luoliwoshang in #408
- test(e2etest):llgo run lock by @luoliwoshang in #407
unit test:
- test:all llgo cmptest to llgo test by @luoliwoshang in #370
- test(ncimpl&cl/convert):patch refactored test by @luoliwoshang in #383
- feat(llcpptest): test packages concurrently by @MeteorsLiu in #398
- fix(llcppgtest): use mutex to protect
llgo runby @MeteorsLiu in #401
deps & ci:
- build(deps): bump github.com/qiniu/x from 1.14.6 to 1.15.0 by @dependabot in #374
- deps:gopmod->xgomod 0.17.0 by @luoliwoshang in #376
- Upgrade llgo to avoid process stucking by @MeteorsLiu in #378
- deps:rm cjson by @luoliwoshang in #397
- ci:continue run when other matrix fail by @luoliwoshang in #409
docs:
- docs(readme):release badge by @luoliwoshang in #395
changes:
- chore:rm todo in lua test case by @luoliwoshang in #381
- refactor(config/GetConfig): replace cjson with json by @MeteorsLiu in #382
- refactor(pkgFileInfo):minize param instead llcppg.cfg by @luoliwoshang in #388
Full Changelog: v0.5.0...v0.5.1