Move libspl_assertf into .c file

Variadic functions cannot be inlined. libspl_assertf ends up being
duplicated in every file that uses it.

Fix this by moving the function into a new assert.c. Also move the
definition of aok into the new file instead of zone.c.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538
This commit is contained in:
Arvind Sankar
2020-07-04 18:24:13 -04:00
committed by Brian Behlendorf
parent 2054f35e56
commit b6437ea41c
6 changed files with 64 additions and 33 deletions
+8 -2
View File
@@ -17,7 +17,10 @@ AM_CFLAGS += $(LIBTIRPC_CFLAGS)
AM_CCASFLAGS = \
$(CFLAGS)
noinst_LTLIBRARIES = libspl.la
noinst_LTLIBRARIES = libspl_assert.la libspl.la
libspl_assert_la_SOURCES = \
assert.c
USER_C = \
list.c \
@@ -49,4 +52,7 @@ libspl_la_SOURCES = \
$(USER_C) \
$(TARGET_CPU_ATOMIC_SOURCE)
libspl_la_LIBADD = -lrt $(LIBTIRPC_LIBS)
libspl_la_LIBADD = \
libspl_assert.la
libspl_la_LIBADD += -lrt $(LIBTIRPC_LIBS)