File: cleanup.h

package info (click to toggle)
iwd 3.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,176 kB
  • sloc: ansic: 140,705; sh: 5,514; makefile: 714
file content (15 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Embedded Linux library
 * Copyright (C) 2021  Intel Corporation
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once

#define __L_AUTODESTRUCT(func)				\
	__attribute((cleanup(_l_ ## func ## _cleanup)))

#define DEFINE_CLEANUP_FUNC(func)			\
	inline __attribute__((always_inline))		\
	void _l_ ## func ## _cleanup(void *p) { func(*(void **) p); }