Make byteswap functions portable so that sflowtool can build on Mac#50
Make byteswap functions portable so that sflowtool can build on Mac#50ravd wants to merge 1 commit intosflow:masterfrom
Conversation
|
I don't have the Xcode build tools installed on my Mac, but I think the right way to do this it to edit configure.ac and add byteswap.h to the AC_CHECK_HEADERS list. That will cause HAVE_BYTESWAP_H to be set to 1 or 0 in config.h when you rebuild. And then you can do something like this in sflowtool.c: Or use the code you suggested if those builtins do not exist (I didn't check any of this). Having said all that, I suggest you just run sflowtool under docker. It's more likely to work as expected, and the overhead is small. Just try this: docker run sflowtool |
|
I finally got around to trying this properly, and of course I learned that _builtin_bswap* is not known to the compiler on macOS. So the latest sflowtool.c includes something closer to what was proposed. Please review when you have time. It looks like this: #if HAVE_BYTESWAP_H #define bswap_32(value) #define bswap_64(value) |
No description provided.