VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/drm/vbox_err.h@ 68848

Last change on this file since 68848 was 68848, checked in by vboxsync, 7 years ago

Additions/linux/drm: lots of formatting changes to match kernel style.
bugref:8524: Additions/linux: play nicely with distribution-installed Additions

This change makes a lot of formatting changes to the Linux Additions drm
driver, with no intended changes to functionality, and much of the
formatting change done using the sed script which installs the driver
sources to the Additions archive. Hans de Goede's clean-up of the driver for
submission to staging is the base for these changes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/** @file
2 * VirtualBox Video driver, common code - iprt and VirtualBox macros and
3 * definitions.
4 */
5
6/*
7 * Copyright (C) 2017 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28#ifndef __VBOX_ERR_H__
29#define __VBOX_ERR_H__
30
31/** @name VirtualBox error macros
32 * @{ */
33
34#define VINF_SUCCESS 0
35#define VERR_INVALID_PARAMETER (-2)
36#define VERR_INVALID_POINTER (-6)
37#define VERR_NO_MEMORY (-8)
38#define VERR_NOT_IMPLEMENTED (-12)
39#define VERR_INVALID_FUNCTION (-36)
40#define VERR_NOT_SUPPORTED (-37)
41#define VERR_TOO_MUCH_DATA (-42)
42#define VERR_INVALID_STATE (-79)
43#define VERR_OUT_OF_RESOURCES (-80)
44#define VERR_ALREADY_EXISTS (-105)
45#define VERR_INTERNAL_ERROR (-225)
46
47#define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS )
48#define RT_SUCCESS(rc) ( likely(RT_SUCCESS_NP(rc)) )
49#define RT_FAILURE(rc) ( unlikely(!RT_SUCCESS_NP(rc)) )
50
51/** @} */
52
53/** @name VirtualBox assertions
54 * @{ */
55
56/* Unlike BUILD_BUG_ON(), these can be used outside of functions. */
57extern int vbox_assert_var[1];
58#define assert_compile(expr) \
59 extern int vbox_assert_var[1] __attribute__((__unused__)), \
60 vbox_assert_var[(expr) ? 1 : 0] __attribute__((__unused__))
61#define assert_compile_size(type, size) \
62 assert_compile(sizeof(type) == (size))
63
64/** @} */
65
66#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette