]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Gcc doesn't support handle markup
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 13 Oct 2021 14:06:38 +0000 (09:06 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 13 Oct 2021 14:06:38 +0000 (09:06 -0500)
src/include/build.h
src/lib/server/exfile.h
src/lib/server/pool.h

index 1536068603b3ce8ed27108935df7a4e2107447a2..1e354f3419db529311824aea1f34738f80c3886f 100644 (file)
@@ -259,6 +259,19 @@ do { \
  */
 #define PRAGMA(_x) _Pragma(#_x)
 
+/*
+ *     Handle acquire/release macros
+ */
+#ifdef __clang__
+#  define CC_ACQUIRE_HANDLE(_tag) CC_HINT(acquire_handle(_tag))
+#  define CC_USE_HANDLE(_tag) CC_HINT(use_handle(_tag))
+#  define CC_RELEASE_HANDLE(_tag) CC_HINT(release_handle(_tag))
+#else
+#  define CC_ACQUIRE_HANDLE(_tag)
+#  define CC_USE_HANDLE(_tag)
+#  define CC_RELEASE_HANDLE(_tag)
+#endif
+
 /*
  *     Macros for controlling warnings in GCC >= 4.2 and clang >= 2.8
  */
index ff826a370b21a0dd59c732033768d3237b9477ec..662904abff08bdfb03ac421e20610587192b2d75 100644 (file)
@@ -40,10 +40,10 @@ exfile_t    *exfile_init(TALLOC_CTX *ctx, uint32_t entries, fr_time_delta_t idle, b
 void           exfile_enable_triggers(exfile_t *ef, CONF_SECTION *cs, char const *trigger_prefix,
                                       fr_pair_list_t *trigger_args);
 
-CC_HINT(acquire_handle("exfile_fd"))
+CC_ACQUIRE_HANDLE("exfile_fd")
 int            exfile_open(exfile_t *lf, char const *filename, mode_t permissions);
 
-int            exfile_close(exfile_t *lf, CC_HINT(release_handle("exfile_fd")) int fd);
+int            exfile_close(exfile_t *lf, CC_RELEASE_HANDLE("exfile_fd") int fd);
 
 #ifdef __cplusplus
 }
index 8261f121a36675062b24a43019381b289aecda81..7f02e5682a89ad8d15be72afd8331064df14611d 100644 (file)
@@ -167,17 +167,17 @@ void      fr_pool_free(fr_pool_t *pool);
 /*
  *     Connection lifecycle
  */
-CC_HINT(acquire_handle("conn_pool_handle"))
+CC_ACQUIRE_HANDLE("conn_pool_handle")
 void   *fr_pool_connection_get(fr_pool_t *pool, request_t *request);
 
 void   fr_pool_connection_release(fr_pool_t *pool, request_t *request,
-                                  CC_HINT(release_handle("conn_pool_handle")) void *conn);
+                                  CC_RELEASE_HANDLE("conn_pool_handle") void *conn);
 
 void   *fr_pool_connection_reconnect(fr_pool_t *pool, request_t *request,
-                                     CC_HINT(use_handle("conn_pool_handle")) void *conn);
+                                     CC_RELEASE_HANDLE("conn_pool_handle") void *conn);
 
 int    fr_pool_connection_close(fr_pool_t *pool,
-                                request_t *request, CC_HINT(release_handle("conn_pool_handle")) void *conn);
+                                request_t *request, CC_RELEASE_HANDLE("conn_pool_handle") void *conn);
 
 #ifdef __cplusplus
 }