diff --git a/tests/virportallocatormock.c b/tests/virportallocatormock.c index e44191ef7e731c3f675847f2d7f7786106a957f8..fa6e75b2faea87bcf40242a5e98168d498bf0230 100644 --- a/tests/virportallocatormock.c +++ b/tests/virportallocatormock.c @@ -25,7 +25,7 @@ # include #endif -#if defined(RTLD_NEXT) +#if defined(__linux__) && defined(RTLD_NEXT) # include "internal.h" # include # include @@ -105,4 +105,6 @@ int bind(int sockfd ATTRIBUTE_UNUSED, return 0; } -#endif /* ! defined(RTLD_NEXT) */ +#else /* defined(__linux__) && defined(RTLD_NEXT) */ +/* Nothing to override on other platforms. */ +#endif diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 1a5d759bfa2464d7e352df32cc7d6418e7d862eb..45742153131f3d1c431b8835400a334ee92fae52 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -27,7 +27,8 @@ # include #endif -#if defined(RTLD_NEXT) +#if defined(__linux__) && defined(RTLD_NEXT) + # include "virutil.h" # include "virerror.h" # include "viralloc.h" @@ -174,7 +175,7 @@ mymain(void) } VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virportallocatormock.so") -#else /* ! defined(RTLD_NEXT) */ +#else /* defined(__linux__) && defined(RTLD_NEXT) */ int main(void) {