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

c generator: Allow setting the function pointer field name prefix. #403

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

Conversation

rpavlik
Copy link

@rpavlik rpavlik commented Jan 13, 2023

To avoid symbol conflicts.

I don't super love my implementation here because it encodes the whole "prefix + _ + name" thing in more than one place, but it doesn't make it less DRY than it was before.

@makichiis
Copy link
Contributor

Might be necro, but I actually like this idea. However, is a default value specified for the prefix parameter? If not, I think it should have a default glad value.

@Dav1dde
Copy link
Owner

Dav1dde commented Apr 3, 2024

Sorry I should have at least put a comment here, this is still on my "to consider" list, it is very simple so I might still end up doing it, but my stance was always it's easier/better to just ran sed on the generated files, this will catch all occurences.

Making the prefix configurable within the code generation just makes everything a lot more ugly, if it is done for all symbols (including API, defines etc.), but maybe just the exported symbols is enough.

@makichiis
Copy link
Contributor

Hi @Dav1dde,

I think a lot of people that use glad2 write on Windows. I think this feature would be very helpful to people using systems without Unix commands.

I'd also like to re-emphasize that I think the prefix parameter should be optional, such that not specifying it at all defaults to glad anyway. I think this would be really convenient to have in the build system especially when using CMake.

Thank you for reading

@Dav1dde
Copy link
Owner

Dav1dde commented Apr 3, 2024

I think this would be really convenient to have in the build system especially when using CMake.

CMake is one of my main painpoints and if there wasnt so many people using it, I would have already deleted it. You're better off including the generated files in your repo.

Which also means as a Windows user you can use search and replace of your IDE, although this is more a change that is useful for library authors not application/game developers.

@makichiis
Copy link
Contributor

Hi @Dav1dde,

I understand what you're getting at. Also, I sympathize with your dislike of CMake. I personally include GLAD headeronly anyway, because I don't like using it through CMake. I try to use CMake as little as possible, though I was trying to consider alternative use cases.

Thank you for responding

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