build: Add conditional compilation
Two conditionals are introduced in this commit:
- if <ifaddrs.h> is not available, NetworkInterface helper will always return
an empty set of interfaces
- If dropping/elevating effective user/group is not supported, an error
will be thrown if used (e.g., if general.user or general.group is
configured)
Both conditionals are necessary on Android platform.
Change-Id: Ib360e03514af97ed2d68032fbcbe279a8dc84682
diff --git a/core/privilege-helper.hpp b/core/privilege-helper.hpp
index 92bd53d..db22177 100644
--- a/core/privilege-helper.hpp
+++ b/core/privilege-helper.hpp
@@ -65,18 +65,19 @@
static void
runElevated(function<void()> f);
-private:
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static void
raise();
private:
-
+#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
static uid_t s_normalUid;
static gid_t s_normalGid;
static uid_t s_privilegedUid;
static gid_t s_privilegedGid;
+#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
};
} // namespace nfd