Roll DEPS for libelf clang compilation fix.
[chromium-blink-merge.git] / third_party / libva / va / va_compat.h
blob41a3f73e7e0030906be06ec9a3d36b26c1b17197
1 /*
2 * Copyright (c) 2007-2011 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 /**
26 * \file va_compat.h
27 * \brief The Compatibility API
29 * This file contains the \ref api_compat "Compatibility API".
32 #ifndef VA_COMPAT_H
33 #define VA_COMPAT_H
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
39 /**
40 * \defgroup api_compat Compatibility API
42 * The Compatibility API allows older programs that are not ported to
43 * the current API to still build and run correctly. In particular,
44 * this exposes older API to allow for backwards source compatibility.
46 * @{
49 /**
50 * Makes a string literal out of the macro argument
52 #define VA_CPP_HELPER_STRINGIFY(x) \
53 VA_CPP_HELPER_STRINGIFY_(x)
54 #define VA_CPP_HELPER_STRINGIFY_(x) \
57 /**
58 * Concatenates two macro arguments at preprocessing time.
60 #define VA_CPP_HELPER_CONCAT(a, b) \
61 VA_CPP_HELPER_CONCAT_(a, b)
62 #define VA_CPP_HELPER_CONCAT_(a, b) \
63 a ## b
65 /**
66 * Generates the number of macro arguments at preprocessing time.
67 * <http://groups.google.com/group/comp.std.c/browse_thread/thread/77ee8c8f92e4a3fb/346fc464319b1ee5>
69 * Note: this doesn't work for macros with no arguments
71 #define VA_CPP_HELPER_N_ARGS(...) \
72 VA_CPP_HELPER_N_ARGS_(__VA_ARGS__, VA_CPP_HELPER_N_ARGS_LIST_REV())
73 #define VA_CPP_HELPER_N_ARGS_(...) \
74 VA_CPP_HELPER_N_ARGS_LIST(__VA_ARGS__)
75 #define VA_CPP_HELPER_N_ARGS_LIST(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a12, a13, a14, a15, a16, N, ...) N
76 #define VA_CPP_HELPER_N_ARGS_LIST_REV() \
77 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
79 /**
80 * Generates a versioned function alias.
82 * VA_CPP_HELPER_ALIAS(vaSomeFunction, 0,32,0) will generate
83 * .symber vaSomeFunction_0_32_0, vaSomeFunction@VA_API_0.32.0
85 #define VA_CPP_HELPER_ALIAS(func, major, minor, micro) \
86 VA_CPP_HELPER_ALIAS_(func, major, minor, micro, "@")
87 #define VA_CPP_HELPER_ALIAS_DEFAULT(func, major, minor, micro) \
88 VA_CPP_HELPER_ALIAS_(func, major, minor, micro, "@@")
89 #define VA_CPP_HELPER_ALIAS_(func, major, minor, micro, binding) \
90 asm(".symver " #func "_" #major "_" #minor "_" #micro ", " \
91 #func binding "VA_API_" #major "." #minor "." #micro)
93 /* vaCreateSurfaces() */
95 #ifndef VA_COMPAT_DISABLED
96 #define vaCreateSurfaces(dpy, ...) \
97 VA_CPP_HELPER_CONCAT(vaCreateSurfaces, \
98 VA_CPP_HELPER_N_ARGS(dpy, __VA_ARGS__)) \
99 (dpy, __VA_ARGS__)
100 #endif
102 #define vaCreateSurfaces6(dpy, width, height, format, num_surfaces, surfaces) \
103 (vaCreateSurfaces)(dpy, format, width, height, surfaces, num_surfaces, \
104 NULL, 0)
106 #define vaCreateSurfaces8(dpy, format, width, height, surfaces, num_surfaces, attribs, num_attribs) \
107 (vaCreateSurfaces)(dpy, format, width, height, surfaces, num_surfaces, \
108 attribs, num_attribs)
110 /*@}*/
112 #ifdef __cplusplus
114 #endif
116 #endif /* VA_COMPAT_H */