diff options
author | David Lamparter <equinox@diac24.net> | 2021-03-16 11:03:44 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-05-02 16:27:17 +0200 |
commit | 64dd77361f7ab97365d264408afb538097c0339c (patch) | |
tree | fb9350dd6f43fae80b8d3e67cbb285901f42e125 /Makefile.am | |
parent | *: remaining zassert => assert (diff) | |
download | frr-64dd77361f7ab97365d264408afb538097c0339c.tar.xz frr-64dd77361f7ab97365d264408afb538097c0339c.zip |
lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.
Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index e4149b62e..a5101df2f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,11 +11,19 @@ AM_CFLAGS = \ $(SAN_FLAGS) \ $(WERROR) \ # end -AM_CPPFLAGS = \ + +# CPPFLAGS_BASE does not contain the include path for overriding assert.h, +# therefore should be used in tools that do *not* link libfrr or do not want +# assert() overridden +CPPFLAGS_BASE = \ -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \ -I$(top_builddir) \ $(LUA_INCLUDE) \ # end +AM_CPPFLAGS = \ + -I$(top_srcdir)/lib/assert \ + $(CPPFLAGS_BASE) \ + # end AM_LDFLAGS = \ -export-dynamic \ $(AC_LDFLAGS) \ |