You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related something that is currently hard to do? Please describe.
vim contains very "generic" defines such as #define OK 1. When using vim as a library, these defines can leak out to the rest of the app and cause some grief.
Describe the solution you'd like
I am unsure of a truly good solution. But maybe libvim.h should not include vim.h, which pulls in all of vim, but rather pull in a more strategic set of files?
Another possible solution is to namespace these defines, like #define VIM_OK 1 but can certainly understand why changing vim's code is not so great.
And of course, another solution is just ignore this problem. I suppose it depends on how far libvim gets used. If it really only ever powers Oni, then this might not matter.
Describe alternatives you've considered
I have used #undef after #includeing libvim.h, which patches the problem. But since I don't know what defines vim has made, I am unsure when/if this will bite me again in the future.
The text was updated successfully, but these errors were encountered:
But maybe libvim.h should not include vim.h, which pulls in all of vim, but rather pull in a more strategic set of files?
I agree - I think this is the correct solution. The vim.h pulls in a lot of defines, which aren't really necessary - we mainly use to pull some types from structs.h that are shared. I think what would be preferable is to move these shared types to something like libvim_common.h that both vim.h and libvim.h include - that would give us a more minimal set of defines that are more scoped to libvim's API.
Is your feature request related something that is currently hard to do? Please describe.
vim contains very "generic" defines such as
#define OK 1
. When using vim as a library, these defines can leak out to the rest of the app and cause some grief.Describe the solution you'd like
I am unsure of a truly good solution. But maybe
libvim.h
should not includevim.h
, which pulls in all of vim, but rather pull in a more strategic set of files?Another possible solution is to namespace these defines, like
#define VIM_OK 1
but can certainly understand why changing vim's code is not so great.And of course, another solution is just ignore this problem. I suppose it depends on how far libvim gets used. If it really only ever powers Oni, then this might not matter.
Describe alternatives you've considered
I have used
#undef
after#include
ing libvim.h, which patches the problem. But since I don't know what defines vim has made, I am unsure when/if this will bite me again in the future.The text was updated successfully, but these errors were encountered: