Skip to content
Snippets Groups Projects
Commit 0c58f799 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

libknot: merge attributes with libdnssec/shared/shared.h

parent 0bebc7b0
No related branches found
No related tags found
No related merge requests found
/* Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -29,11 +29,7 @@
#include <gnutls/x509.h>
#include "libdnssec/binary.h"
#define _public_ __attribute__((visibility("default")))
#define _hidden_ __attribute__((visibility("hidden")))
#define _unused_ __attribute__((unused))
#include "libknot/attribute.h"
/*!
* Macro to clear a structure of known size.
......@@ -42,12 +38,8 @@
*/
#define clear_struct(pointer) memset((pointer), '\0', sizeof(*(pointer)))
#define streq(one, two) (strcmp((one), (two)) == 0)
/* -- cleanup macros ------------------------------------------------------- */
#define _cleanup_(var) __attribute__((cleanup(var)))
static inline void free_ptr(void *ptr)
{
free(*(void **)ptr);
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -17,7 +17,7 @@
/*!
* \file
*
* \brief Function attributes.
* \brief Function and variable attributes.
*
* \addtogroup libknot
* @{
......@@ -29,6 +29,10 @@
#define _public_ __attribute__((visibility("default")))
#define _hidden_ __attribute__((visibility("hidden")))
#define _unused_ __attribute__((unused))
#define _cleanup_(var) __attribute__((cleanup(var)))
/*! \brief GNU C function attributes. */
#if __GNUC__ >= 3
#define _pure_ __attribute__ ((pure))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment