Skip to content

add prologue callback right next to epilogue callback #180

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

some-mthfka
Copy link

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
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
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.

@@ -537,7 +537,7 @@ target package."
(with-standard-io-syntax
(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
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
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
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
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
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
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