Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(llgo/doc) : Add a document named "LLGO Migration for C/C++ Third-Party Libraries" #532

Conversation

morpingsss
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.72%. Comparing base (2935ae7) to head (a027e9f).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #532   +/-   ##
=======================================
  Coverage   97.71%   97.72%           
=======================================
  Files          19       19           
  Lines        4511     4523   +12     
=======================================
+ Hits         4408     4420   +12     
  Misses         87       87           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@morpingsss morpingsss changed the title docs(llgo/doc) : Add a document :Add a document named "LLGO Migration for C/C++ Third-Party Libraries" docs(llgo/doc) : Add a document named "LLGO Migration for C/C++ Third-Party Libraries" Jul 18, 2024
@@ -0,0 +1,461 @@
# LLGO Migration for C/C++ Third-Party Libraries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use space in filename

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to llgo_migration_for_c_c++_third-party_libraries

brew install inih
```

### Compiling from Source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends. There is no need to describe how to install from source code, just prompt to prioritize binary installation unless the package you want to support is not supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people need to compile and install from source code, such as those who migrate godot


```bash
cd inih/_demo/inih_demo
llgo run inih_demo.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llgo run . is better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code updated

```bash
cd inih/_demo/inih_demo
llgo run inih_demo.go

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't leave blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code updated

BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
BLEND_CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendFactors())
BLEND_CUSTOM_SEPARATE // Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
} BlendMode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code updated

//llgo:type C
type Comp func(a c.Int)

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be need more detail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Details added


### Handling char ** Type in C

Handle char ** as `[]*c.Char`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code updated

clang++ -dynamiclib x.cpp -o {users third-party libraries path}/lib/libbar.dylib -lfmt -std=c++11
# Generate pc for the corresponding dylib
# Install via `https://github.com/hackerchai/dylib-installer`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these blank lines need to be trimmed.

```jsx
0000000000003e55 T _ini_parse

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end of a code block (```) should be followed by a blank line.

├──inih_demo.go
├── INIReader_demo
├──reader_demo.go
├── _wrap/cpp_wrap.cpp (optional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't name it _wrap/cpp_wrap.cpp, naming it _wrap/reader.cpp is better.

@xushiwei xushiwei merged commit 85b16b2 into goplus:main Jul 18, 2024
3 checks passed
@morpingsss morpingsss deleted the morpingsss/LLGO-Migration-for-C-C++-Third-Party-Libraries branch July 23, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants