From 868bc96e72f3d21f30368a50e36c6a04ad810478 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Wed, 10 Aug 2016 18:16:39 +0200 Subject: kms++-util: portability fix __STRING(x) is a glibcism (i.e. it is non-standard), that happens to be also available with uClibc, but is not with musl. Define it if not already defined, using the same trivial definition as is done by both glibg and uClibc. Signed-off-by: "Yann E. MORIN" --- kms++util/inc/kms++util/kms++util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h index 10a1f0a..5a688f6 100644 --- a/kms++util/inc/kms++util/kms++util.h +++ b/kms++util/inc/kms++util/kms++util.h @@ -35,6 +35,13 @@ Connector* resolve_connector(Card& card, const std::string& str); #define unlikely(x) __builtin_expect(!!(x), 0) +/* __STRING(x) is a glibcism (i.e. not standard), which happens to also + * be available in uClibc. However, musl does not define it. Do it here. + */ +#ifndef __STRING +#define __STRING(x) #x +#endif + #define ASSERT(x) \ if (unlikely(!(x))) { \ fprintf(stderr, "%s:%d: %s: ASSERT(%s) failed\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, __STRING(x)); \ -- cgit v1.2.3 From 35373b7829fdc49407f4c256c603a137b957a1ad Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Wed, 10 Aug 2016 18:34:28 +0200 Subject: utils: select() et al. need Although indirectly included by way of other headers with glibc and uClibc, using any of the select()-class familly of functions or macros requires including . This fixes the build under musl, which is way more conservative in the ehaders that are included one-from-the-others (k.e. as few as possible). Signed-off-by: "Yann E. MORIN" --- utils/testpat.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/testpat.cpp b/utils/testpat.cpp index ef56a80..7208105 100644 --- a/utils/testpat.cpp +++ b/utils/testpat.cpp @@ -5,6 +5,8 @@ #include #include +#include + #include #include -- cgit v1.2.3