Ruby: include/ruby/internal/compiler_is/msvc.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

msvc.h
Go to the documentation of this file.
1#ifndef RBIMPL_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_COMPILER_IS_MSVC_H
23#include "ruby/internal/compiler_is/clang.h"
24#include "ruby/internal/compiler_is/intel.h"
25
26#if ! defined(_MSC_VER)
27# define RBIMPL_COMPILER_IS_MSVC 0
28
29#elif RBIMPL_COMPILER_IS(Clang)
30# define RBIMPL_COMPILER_IS_MSVC 0
31
32#elif RBIMPL_COMPILER_IS(Intel)
33# define RBIMPL_COMPILER_IS_MSVC 0
34
35#elif _MSC_VER >= 1400
36# define RBIMPL_COMPILER_IS_MSVC 1
37# /* _MSC_FULL_VER = XXYYZZZZZ */
38# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 10000000)
39# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 10000000 / 100000)
40# define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 100000)
41
42#elif defined(_MSC_FULL_VER)
43# define RBIMPL_COMPILER_IS_MSVC 1
44# /* _MSC_FULL_VER = XXYYZZZZ */
45# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 1000000)
46# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 1000000 / 10000)
47# define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 10000)
48
49#else
50# define RBIMPL_COMPILER_IS_MSVC 1
51# /* _MSC_VER = XXYY */
52# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_VER / 100)
53# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_VER % 100)
54# define RBIMPL_COMPILER_VERSION_PATCH 0
55#endif
56
57#endif /* RBIMPL_COMPILER_IS_MSVC_H */
clang.h
Defines RBIMPL_COMPILER_IS_Clang.
intel.h
Defines RBIMPL_COMPILER_IS_Intel.