Imported Upstream version 1.4
[deb_x265.git] / source / common / version.cpp
CommitLineData
72b9787e
JB
1/*****************************************************************************
2 * Copyright (C) 2013 x265 project
3 *
4 * Authors: Steve Borho <steve@borho.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
19 *
20 * This program is also available under a commercial proprietary license.
21 * For more information, contact us at license @ x265.com.
22 *****************************************************************************/
23
24#include "x265.h"
25#include "common.h"
26
27#define XSTR(x) STR(x)
28#define STR(x) #x
29
30#if defined(__clang__)
31#define NVM_COMPILEDBY "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
32#ifdef __IA64__
33#define NVM_ONARCH "[on 64-bit] "
34#else
35#define NVM_ONARCH "[on 32-bit] "
36#endif
37#endif
38
39#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
40#define NVM_COMPILEDBY "[GCC " XSTR(__GNUC__) "." XSTR(__GNUC_MINOR__) "." XSTR(__GNUC_PATCHLEVEL__) "]"
41#ifdef __IA64__
42#define NVM_ONARCH "[on 64-bit] "
43#else
44#define NVM_ONARCH "[on 32-bit] "
45#endif
46#endif
47
48#ifdef __INTEL_COMPILER
49#define NVM_COMPILEDBY "[ICC " XSTR(__INTEL_COMPILER) "]"
50#elif _MSC_VER
51#define NVM_COMPILEDBY "[MSVC " XSTR(_MSC_VER) "]"
52#endif
53
54#ifndef NVM_COMPILEDBY
55#define NVM_COMPILEDBY "[Unk-CXX]"
56#endif
57
58#ifdef _WIN32
59#define NVM_ONOS "[Windows]"
60#elif __linux
61#define NVM_ONOS "[Linux]"
62#elif __OpenBSD__
63#define NVM_ONOS "[OpenBSD]"
64#elif __CYGWIN__
65#define NVM_ONOS "[Cygwin]"
66#elif __APPLE__
67#define NVM_ONOS "[Mac OS X]"
68#else
69#define NVM_ONOS "[Unk-OS]"
70#endif
71
72#if X86_64
73#define NVM_BITS "[64 bit]"
74#else
75#define NVM_BITS "[32 bit]"
76#endif
77
78#if CHECKED_BUILD
79#define CHECKED "[CHECKED] "
80#else
81#define CHECKED " "
82#endif
83
84#if HIGH_BIT_DEPTH
85#define BITDEPTH "16bpp"
86const int x265_max_bit_depth = 10;
87#else
88#define BITDEPTH "8bpp"
89const int x265_max_bit_depth = 8;
90#endif
91
92const char *x265_version_str = XSTR(X265_VERSION);
93const char *x265_build_info_str = NVM_ONOS NVM_COMPILEDBY NVM_BITS CHECKED BITDEPTH;