4 ms·
I see it both ways. On the one hand, sure Windows vs macOS vs "Linux/BSD" is so very different, you mainly need OS detection. On the other, I don't need a lis
by amiga386 2y ago
I see it both ways.
On the one hand, sure Windows vs macOS vs "Linux/BSD" is so very different, you mainly need OS detection.
On the other, I don't need a list of the exact featuresets of Fedora, Debian, FreeBSD, NetBSD, OpenBSD, DragonBSD, MorphOS, etc. so I can write narcissism-of-small-differences shit like:
#if defined(SUNOS_V4) || defined(_MSC_VER) || defined(GNU) || defined(FREEBSD)
# include <strings.h>
#else
# include <string.h>
#endif
I will _gladly_ run a feature test and write:
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
That is soooooooo much cleaner
- bandrami 2y agoThis came up with musl, IIRC, and was problematic: the existence of a named header doesn't guarantee it contains what you think it does
- johnisgood 2y agoSpeaking of, I am using https://zolk3ri.name/cgit/m4conf/about/ https://zolk3ri.name/cgit/m4conf/about/ so I do not have to use anything more bloated or complex.