]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
only need this for debug builds
authorAlan T. DeKok <aland@freeradius.org>
Tue, 23 Jan 2024 02:25:20 +0000 (21:25 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 23 Jan 2024 02:26:06 +0000 (21:26 -0500)
src/lib/bio/base.c
src/lib/bio/buf.h

index dac9317181acff2f68811a7ab32742998e7bcc5b..48df6d65998216ca2098a6d6a13276ccc2c605e2 100644 (file)
@@ -25,6 +25,7 @@
 #include <freeradius-devel/bio/bio_priv.h>
 #include <freeradius-devel/bio/null.h>
 
+#ifndef NDEBUG
 /** Free this bio.
  *
  *  The bio can only be freed if it is not in any chain.
@@ -39,6 +40,7 @@ int fr_bio_destructor(fr_bio_t *bio)
         */
        return 0;
 }
+#endif
 
 /** Always returns EOF on fr_bio_read()
  *
index d8e237145b1315488265dbea6f785794af3e0587..f7b175a766999022e2e46b57bf1bd42ac27eb1ef 100644 (file)
@@ -50,6 +50,7 @@ size_t                fr_bio_buf_read(fr_bio_buf_t *bio_buf, void *buffer, size_t size) CC_HIN
 ssize_t                fr_bio_buf_write(fr_bio_buf_t *bio_buf, const void *buffer, size_t size) CC_HINT(nonnull);
 
 
+#ifndef NDEBUG
 static inline void CC_HINT(nonnull) fr_bio_buf_verify(fr_bio_buf_t const *bio_buf)
 {
        fr_assert(bio_buf->start != NULL);
@@ -57,6 +58,9 @@ static inline void CC_HINT(nonnull) fr_bio_buf_verify(fr_bio_buf_t const *bio_bu
        fr_assert(bio_buf->read <= bio_buf->write);
        fr_assert(bio_buf->write <= bio_buf->end);
 }
+#else
+#define fr_bio_buf_verify(_x)
+#endif
 
 static inline void CC_HINT(nonnull) fr_bio_buf_reset(fr_bio_buf_t *bio_buf)
 {