From 553f3f2309e87d95345220463fa865d5fd8cf28d Mon Sep 17 00:00:00 2001 From: X512 Date: Wed, 9 Dec 2020 18:37:12 +0900 Subject: [PATCH] AutoDeleter: add delarations for common types and destructors Change-Id: I74b75a54038d5af370696302f33b5c0abab4820c Reviewed-on: https://review.haiku-os.org/c/haiku/+/3481 Reviewed-by: Adrien Destugues --- .../build/private/shared/AutoDeleterDrivers.h | 1 + headers/build/private/shared/AutoDeleterOS.h | 1 + .../build/private/shared/AutoDeleterPosix.h | 1 + headers/private/shared/AutoDeleterDrivers.h | 43 +++++++++++++++++++ headers/private/shared/AutoDeleterOS.h | 29 +++++++++++++ headers/private/shared/AutoDeleterPosix.h | 31 +++++++++++++ 6 files changed, 106 insertions(+) create mode 100644 headers/build/private/shared/AutoDeleterDrivers.h create mode 100644 headers/build/private/shared/AutoDeleterOS.h create mode 100644 headers/build/private/shared/AutoDeleterPosix.h create mode 100644 headers/private/shared/AutoDeleterDrivers.h create mode 100644 headers/private/shared/AutoDeleterOS.h create mode 100644 headers/private/shared/AutoDeleterPosix.h diff --git a/headers/build/private/shared/AutoDeleterDrivers.h b/headers/build/private/shared/AutoDeleterDrivers.h new file mode 100644 index 0000000000..dce251d271 --- /dev/null +++ b/headers/build/private/shared/AutoDeleterDrivers.h @@ -0,0 +1 @@ +#include <../private/shared/AutoDeleterDrivers.h> diff --git a/headers/build/private/shared/AutoDeleterOS.h b/headers/build/private/shared/AutoDeleterOS.h new file mode 100644 index 0000000000..b3976ff8b6 --- /dev/null +++ b/headers/build/private/shared/AutoDeleterOS.h @@ -0,0 +1 @@ +#include <../private/shared/AutoDeleterOS.h> diff --git a/headers/build/private/shared/AutoDeleterPosix.h b/headers/build/private/shared/AutoDeleterPosix.h new file mode 100644 index 0000000000..9e8e9161a1 --- /dev/null +++ b/headers/build/private/shared/AutoDeleterPosix.h @@ -0,0 +1 @@ +#include <../private/shared/AutoDeleterPosix.h> diff --git a/headers/private/shared/AutoDeleterDrivers.h b/headers/private/shared/AutoDeleterDrivers.h new file mode 100644 index 0000000000..c290ede37f --- /dev/null +++ b/headers/private/shared/AutoDeleterDrivers.h @@ -0,0 +1,43 @@ +/* + * Copyright 2020, Haiku, Inc. + * Distributed under the terms of the MIT License. + */ +#ifndef _AUTO_DELETER_DRIVERS_H +#define _AUTO_DELETER_DRIVERS_H + + +#include +#include +#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE) +#include +#include +#endif + + +namespace BPrivate { + + +typedef CObjectDeleter DriverSettingsUnloader; + +#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE) + +typedef CObjectDeleter VnodePutter; +typedef CObjectDeleter DescriptorPutter; + +#endif + + +} + + +using ::BPrivate::DriverSettingsUnloader; + +#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE) + +using ::BPrivate::VnodePutter; +using ::BPrivate::DescriptorPutter; + +#endif + + +#endif // _AUTO_DELETER_DRIVERS_H diff --git a/headers/private/shared/AutoDeleterOS.h b/headers/private/shared/AutoDeleterOS.h new file mode 100644 index 0000000000..8c48447ad6 --- /dev/null +++ b/headers/private/shared/AutoDeleterOS.h @@ -0,0 +1,29 @@ +/* + * Copyright 2020, Haiku, Inc. + * Distributed under the terms of the MIT License. + */ +#ifndef _AUTO_DELETER_OS_H +#define _AUTO_DELETER_OS_H + + +#include +#include + + +namespace BPrivate { + + +typedef HandleDeleter AreaDeleter; +typedef HandleDeleter SemDeleter; +typedef HandleDeleter PortDeleter; + + +} + + +using ::BPrivate::AreaDeleter; +using ::BPrivate::SemDeleter; +using ::BPrivate::PortDeleter; + + +#endif // _AUTO_DELETER_OS_H diff --git a/headers/private/shared/AutoDeleterPosix.h b/headers/private/shared/AutoDeleterPosix.h new file mode 100644 index 0000000000..82b5ba42f8 --- /dev/null +++ b/headers/private/shared/AutoDeleterPosix.h @@ -0,0 +1,31 @@ +/* + * Copyright 2020, Haiku, Inc. + * Distributed under the terms of the MIT License. + */ +#ifndef _AUTO_DELETER_POSIX_H +#define _AUTO_DELETER_POSIX_H + + +#include +#include +#include +#include + + +namespace BPrivate { + + +typedef CObjectDeleter FileCloser; +typedef CObjectDeleter DirCloser; +typedef CObjectDeleter AttrDirCloser; + + +} + + +using ::BPrivate::FileCloser; +using ::BPrivate::DirCloser; +using ::BPrivate::AttrDirCloser; + + +#endif // _AUTO_DELETER_POSIX_H