OSDN Git Service

Bump release year.
[mhash384/mhash384.git] / src / sysinfo.h
1 /* ---------------------------------------------------------------------------------------------- */
2 /* MHash-384 - System information                                                                 */
3 /* Copyright(c) 2016-2017 LoRd_MuldeR <mulder2@gmx.de>                                            */
4 /*                                                                                                */
5 /* Permission is hereby granted, free of charge, to any person obtaining a copy of this software  */
6 /* and associated documentation files (the "Software"), to deal in the Software without           */
7 /* restriction, including without limitation the rights to use, copy, modify, merge, publish,     */
8 /* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the  */
9 /* Software is furnished to do so, subject to the following conditions:                           */
10 /*                                                                                                */
11 /* The above copyright notice and this permission notice shall be included in all copies or       */
12 /* substantial portions of the Software.                                                          */
13 /*                                                                                                */
14 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING  */
15 /* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND     */
16 /* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   */
17 /* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
18 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.        */
19 /* ---------------------------------------------------------------------------------------------- */
20
21 #ifndef MHASH_CLI_SYSINFO_INCLUDED
22 #define MHASH_CLI_SYSINFO_INCLUDED
23
24 /*Includes*/
25 #include <stdint.h>
26
27 /*System*/
28 #ifdef _WIN32
29 #define SYSTEM_TYPE "Windows"
30 #elif __CYGWIN__
31 #define SYSTEM_TYPE "Cygwin"
32 #elif __MINGW32__
33 #define SYSTEM_TYPE "MinGW"
34 #elif __linux__
35 #define SYSTEM_TYPE "Linux"
36 #elif __unix__
37 #define SYSTEM_TYPE "Unix"
38 #else
39 #define SYSTEM_TYPE "Unknown"
40 #endif
41
42 /*Compiler*/
43 #ifdef __INTEL_COMPILER
44 #define COMPILER_TYPE "Intel(R) C/C++ Compiler"
45 #define COMPILER_VERS_MAJOR ((uint32_t)__INTEL_COMPILER)
46 #define COMPILER_VERS_MINOR (((uint32_t)__INTEL_COMPILER_BUILD_DATE) / ((uint32_t)10000))
47 #define COMPILER_VERS_PATCH (((uint32_t)__INTEL_COMPILER_BUILD_DATE) % ((uint32_t)10000))
48 #if defined(_M_X64) || defined(__x86_64__)
49 #define COMPILER_ARCH "x64"
50 #else
51 #define COMPILER_ARCH "x86"
52 #endif
53 #else
54 #ifdef _MSC_FULL_VER
55 #define COMPILER_TYPE "Microsoft(R) C/C++ Compiler"
56 #define COMPILER_VERS_MAJOR (((uint32_t)_MSC_FULL_VER) / ((uint32_t)10000000))
57 #define COMPILER_VERS_MINOR ((((uint32_t)_MSC_FULL_VER) / ((uint32_t)100000)) % ((uint32_t)100))
58 #define COMPILER_VERS_PATCH (((uint32_t)_MSC_FULL_VER) % ((uint32_t)100000))
59 #ifdef _M_X64
60 #define COMPILER_ARCH "x64"
61 #else
62 #define COMPILER_ARCH "x86"
63 #endif
64 #endif
65 #ifdef __GNUC__
66 #define COMPILER_TYPE "GNU Compiler Collection"
67 #define COMPILER_VERS_MAJOR ((uint32_t)__GNUC__)
68 #define COMPILER_VERS_MINOR ((uint32_t)__GNUC_MINOR__)
69 #define COMPILER_VERS_PATCH ((uint32_t)__GNUC_PATCHLEVEL__)
70 #ifdef __x86_64__
71 #define COMPILER_ARCH "x64"
72 #else
73 #define COMPILER_ARCH "x86"
74 #endif
75 #endif
76 #endif
77
78 #endif /*MHASH_CLI_SYSINFO_INCLUDED*/