-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for OS X #24
base: master
Are you sure you want to change the base?
Conversation
- obstack added as an optional build library (regardless of OS) - application if on OS X will use the correct getprogname
builds for me now! thanks!! great work :D |
Thank you, @ShaharHD, very nice work. However, I'd rather not add obstack source code to hidrd. I'd keep this PR open for others to pick up, but would prefer the code switched to malloc and remove the dependency altogether. |
@spbnick I'll change the PR to use malloc rather then incorporating obstack. |
Convert from using obstack to use malloc and free
No need to check for NULL on next before calling
@spbnick I've removed obstack as requested. |
Thank you, @ShaharHD, I looked through it quickly, and it looks good, but need to find time for an in-depth review still. |
@spbnick any updates? |
Hi @ShaharHD, I took a deeper look at the PR, and would like to ask you to get rid of program_invocation(_short)_name properly, instead of just defining it to be a pointer to a function cast to string. A good approach could be implementing the GNU version of basename and using that on Please also rebase on #26 to pick up OS X test fixes, and to have CI for your changes. |
@spbnick just to confirm, as it seems you already rebased my code, take https://github.com/spbnick/hidrd/tree/add_osx_support as my base? |
As OS X already has the implemantion, and it seems just like a GNU vs OS X mapping, another option can be like #undef GET_PROGRAM_NAME
#ifdef __GLIBC__
# define GET_PROGRAM_NAME() program_invocation_short_name
#else /* *BSD and OS X */
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
#endif And use |
Yep! |
Perhaps this could be made more portable and cleaner by using getprogname from libbsd on Linux and directly from the system on OS X. |
obstack
added as an optional build library (regardless of OS)To activate use
./configure --enable-obstack
getprogname
obstack
and now usingmalloc
/free