VirtualBox

source: vbox/trunk/include/VBox/Graphics/VBoxVideoErr.h@ 69177

Last change on this file since 69177 was 69022, checked in by vboxsync, 8 years ago

Additions/linux/drm: move vbox_err.h to include/VBox/Graphics/VBoxVideoErr.h.
bugref:9017: Additions/x11: put vboxvideo into upstream X.Org

Since we do not want the upstream X.Org vboxvideo driver to depend on IPRT
either we move it from Additions/linux/drm to include/VBox/Graphics/ and
add a missing definition while we are at it.

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

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