Skip to content

add prologue callback right next to epilogue callback#180

Open
some-mthfka wants to merge 1 commit intocffi:masterfrom
some-mthfka:master
Open

add prologue callback right next to epilogue callback#180
some-mthfka wants to merge 1 commit intocffi:masterfrom
some-mthfka:master

Conversation

@some-mthfka
Copy link
Copy Markdown

I need this for https://github.com/some-mthfka/hu.dwim.sdl, where one package (aka sdl-ttf) relies on the definitions from another package (sdl-core), and I import all the definitions in prologue. I can't do it in prelude because the generated file redefines the package that it generates.

Or maybe there's indeed another way of doing it?

@luismbo
Copy link
Copy Markdown
Member

luismbo commented Apr 6, 2021

You’ll have to explain your use case in a bit more. I didn’t understand your description. Perhaps @attila-lendvai can chime in too.

@some-mthfka
Copy link
Copy Markdown
Author

@luismbo So, what happens is: the main sdl lib defines certains types/structure such as SDL_Color. Now, SDL-TTF is generated in a seperate package, but some of its function such as render-text-solid rely on these definitions and if it doesn't have them, there will be comments in the generated code that sdl-color was not found and ttf-render-text-solid was skipped. And so I import all the symbols from the core package into the packages that depend on it (well, ommiting the clashing symbols like init or quit) and that solves the problem.

(with-input-from-file (in c2ffi-spec-file :external-format (uiop:encoding-external-format :utf-8))
(with-output-to-file (*c2ffi-output-stream* output :if-exists :supersede
:external-format (uiop:encoding-external-format output-encoding))
:external-format (uiop:encoding-external-format output-encoding))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for git blame it's better to avoid recording changes to parts that you don't need to touch.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Would it solve the problem if I change the indentation back to how it was and push again? Or would it be easier to make another pull request at this point?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@attila-lendvai indentation restored, seems to have done the trick

Copy link
Copy Markdown
Member

@attila-lendvai attila-lendvai Apr 8, 2021

Choose a reason for hiding this comment

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

you made two commits. the point is that commits should not touch unrelated parts of the files unnecessarily.

just amend the patch locally, and then you can git push -f into the PR's branche on github, and the PR gets updated automatically.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@attila-lendvai my bad, got it now!

@attila-lendvai
Copy link
Copy Markdown
Member

FTR, this PR is needed for this issue: hu-dwim/hu.dwim.sdl#2

but for now i'm reluctant to proceed on this. further discussion is under that issue.

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