From: Arran Cudbard-Bell Date: Fri, 8 Oct 2021 21:18:35 +0000 (-0500) Subject: Build private version of pair header X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a271f35a6a8db0ebca529b87e38ecab4531c40d;p=thirdparty%2Ffreeradius-server.git Build private version of pair header --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 7ca6e68f2f3..43d174927e9 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -23,6 +23,8 @@ */ RCSID("$Id$") +#define _PAIR_PRIVATE 1 + #include #include #include diff --git a/src/lib/util/pair.h b/src/lib/util/pair.h index 42e98a54f1a..5e28e68708c 100644 --- a/src/lib/util/pair.h +++ b/src/lib/util/pair.h @@ -32,6 +32,18 @@ RCSIDH(dpair_h, "$Id$") extern "C" { #endif +/* + * Allow public and private versions of the same structures + */ +#ifdef _CONST +# error _CONST can only be defined in the local header +#endif +#ifndef _PAIR_PRIVATE +# define _CONST const +#else +# define _CONST +#endif + #ifdef WITH_VERIFY_PTR # define VP_VERIFY(_x) fr_pair_verify(__FILE__, __LINE__, _x) # define LIST_VERIFY(_x) fr_pair_list_verify(__FILE__, __LINE__, NULL, _x) @@ -423,6 +435,7 @@ typedef struct { ssize_t fr_pair_ctx_afrom_str(fr_pair_ctx_t *pair_ctx, char const *in, size_t inlen); void fr_pair_ctx_reset(fr_pair_ctx_t *pair_ctx, fr_dict_t const *dict); +#undef _CONST #ifdef __cplusplus } #endif