xref: /OK3568_Linux_fs/external/xserver/hw/xfree86/common/xorgVersion.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun 
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (c) 2004, X.Org Foundation
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
6*4882a593Smuzhiyun  * copy of this software and associated documentation files (the "Software"),
7*4882a593Smuzhiyun  * to deal in the Software without restriction, including without limitation
8*4882a593Smuzhiyun  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9*4882a593Smuzhiyun  * and/or sell copies of the Software, and to permit persons to whom the
10*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following conditions:
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included in
13*4882a593Smuzhiyun  * all copies or substantial portions of the Software.
14*4882a593Smuzhiyun  *
15*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18*4882a593Smuzhiyun  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19*4882a593Smuzhiyun  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20*4882a593Smuzhiyun  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21*4882a593Smuzhiyun  * OTHER DEALINGS IN THE SOFTWARE.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * Except as contained in this notice, the name of the copyright holder(s)
24*4882a593Smuzhiyun  * and author(s) shall not be used in advertising or otherwise to promote
25*4882a593Smuzhiyun  * the sale, use or other dealings in this Software without prior written
26*4882a593Smuzhiyun  * authorization from the copyright holder(s) and author(s).
27*4882a593Smuzhiyun  */
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #ifndef XORG_VERSION_H
30*4882a593Smuzhiyun #define XORG_VERSION_H
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #ifndef XORG_VERSION_CURRENT
33*4882a593Smuzhiyun #error
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #define XORG_VERSION_NUMERIC(major,minor,patch,snap,dummy) \
37*4882a593Smuzhiyun 	(((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap)
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #define XORG_GET_MAJOR_VERSION(vers)	((vers) / 10000000)
40*4882a593Smuzhiyun #define XORG_GET_MINOR_VERSION(vers)	(((vers) % 10000000) / 100000)
41*4882a593Smuzhiyun #define XORG_GET_PATCH_VERSION(vers)	(((vers) % 100000) / 1000)
42*4882a593Smuzhiyun #define XORG_GET_SNAP_VERSION(vers)	((vers) % 1000)
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun #define XORG_VERSION_MAJOR	XORG_GET_MAJOR_VERSION(XORG_VERSION_CURRENT)
45*4882a593Smuzhiyun #define XORG_VERSION_MINOR	XORG_GET_MINOR_VERSION(XORG_VERSION_CURRENT)
46*4882a593Smuzhiyun #define XORG_VERSION_PATCH	XORG_GET_PATCH_VERSION(XORG_VERSION_CURRENT)
47*4882a593Smuzhiyun #define XORG_VERSION_SNAP	XORG_GET_SNAP_VERSION(XORG_VERSION_CURRENT)
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #endif
50