MINOR: namespaces: don't build namespace.c if disabled
When namespaces are disabled, support is still reported because the file
is built with almost nothing in it but built anyway. Instead of extending
the scope of the numerous ifdefs in this file, better avoid building it
when namespaces are diabled. In this case we define my_socketat() as an
inline function mapping directly to socket(). The struct netns_entry
still needs to be defined because it's used by various other functions
in the code.
diff --git a/Makefile b/Makefile
index 3b089d2..965d89d 100644
--- a/Makefile
+++ b/Makefile
@@ -871,6 +871,7 @@
ifneq ($(USE_NS),)
OPTIONS_CFLAGS += -DCONFIG_HAP_NS
BUILD_OPTIONS += $(call ignore_implicit,USE_NS)
+OPTIONS_OBJS += src/namespace.o
endif
#### Global link options
@@ -916,7 +917,7 @@
src/hpack-dec.o src/memory.o src/lb_fwrr.o src/lb_chash.o \
src/lb_fas.o src/hathreads.o src/chunk.o src/lb_map.o \
src/xxhash.o src/regex.o src/shctx.o src/buffer.o src/action.o \
- src/h1.o src/compression.o src/pipe.o src/namespace.o \
+ src/h1.o src/compression.o src/pipe.o \
src/sha1.o src/hpack-tbl.o src/hpack-enc.o src/uri_auth.o \
src/time.o src/proto_udp.o src/arg.o src/signal.o \
src/protocol.o src/lru.o src/hdr_idx.o src/hpack-huff.o \