VirtualBox

source: vbox/trunk/src/VBox/Main/src-helper-apps/VBoxVolInfo/libdevmapper-calls.h@ 98718

Last change on this file since 98718 was 98718, checked in by vboxsync, 16 months ago

Main/VBoxVolInfo: Don't link directly against libdevmapper but use the IPRT runtime loader to get rid of the buildtime dependency, bugref:10367 [make scm happy]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/** @file
2 * Stubs for dynamically loading libdevmapper and the symbols which are needed by
3 * VirtualBox.
4 */
5
6/*
7 * Copyright (C) 2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28/** The file name of the libdevmapper library */
29#define RT_RUNTIME_LOADER_LIB_NAME "libdevmapper.so"
30
31/** The name of the loader function */
32#define RT_RUNTIME_LOADER_FUNCTION RTDevmapperLoadLib
33
34/** The following are the symbols which we need from the libdevmapper library. */
35#define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
36 RT_PROXY_STUB(dm_task_create, struct dm_task *, (int type), \
37 (type)) \
38 RT_PROXY_STUB(dm_task_set_name, int, (struct dm_task *dmt, const char *name), \
39 (dmt, name)) \
40 RT_PROXY_STUB(dm_task_run, int, \
41 (struct dm_task *dmt), (dmt)) \
42 RT_PROXY_STUB(dm_task_get_info, int, \
43 (struct dm_task *dmt, struct dm_info *dmi), (dmt, dmi)) \
44 RT_PROXY_STUB(dm_task_get_deps, struct dm_deps *, (struct dm_task *dmt), \
45 (dmt)) \
46 RT_PROXY_STUB(dm_task_destroy, void, (struct dm_task *dmt), \
47 (dmt))
48
49#ifdef VBOX_LIBDEVMAPPER_GENERATE_HEADER
50# define RT_RUNTIME_LOADER_GENERATE_HEADER
51# define RT_RUNTIME_LOADER_GENERATE_DECLS
52# include <iprt/runtime-loader.h>
53# undef RT_RUNTIME_LOADER_GENERATE_HEADER
54# undef RT_RUNTIME_LOADER_GENERATE_DECLS
55
56#elif defined(VBOX_LIBDEVMAPPER_GENERATE_BODY)
57# define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
58# include <iprt/runtime-loader.h>
59# undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
60
61#else
62# error This file should only be included to generate stubs for loading the libdevmapper library at runtime
63#endif
64
65#undef RT_RUNTIME_LOADER_LIB_NAME
66#undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
67
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use