| 1 |
#ifndef RBIMPL_COMPILER_IS_SUNPRO_H /*-*-C++-*-vi:se ft=cpp:*/ |
| 2 |
#define RBIMPL_COMPILER_IS_SUNPRO_H |
| 3 |
/** |
| 4 |
* @author Ruby developers <[email protected]> |
| 5 |
* @copyright This file is a part of the programming language Ruby. |
| 6 |
* Permission is hereby granted, to either redistribute and/or |
| 7 |
* modify this file, provided that the conditions mentioned in the |
| 8 |
* file COPYING are met. Consult the file for details. |
| 9 |
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are |
| 10 |
* implementation details. Don't take them as canon. They could |
| 11 |
* rapidly appear then vanish. The name (path) of this header file |
| 12 |
* is also an implementation detail. Do not expect it to persist |
| 13 |
* at the place it is now. Developers are free to move it anywhere |
| 14 |
* anytime at will. |
| 15 |
* @note To ruby-core: remember that this header can be possibly |
| 16 |
* recursively included from extension libraries written in C++. |
| 17 |
* Do not expect for instance `__VA_ARGS__` is always available. |
| 18 |
* We assume C99 for ruby itself but we don't assume languages of |
| 19 |
* extension libraries. They could be written in C++98. |
| 20 |
* @brief Defines RBIMPL_COMPILER_IS_SunPro. |
| 21 |
*/ |
| 22 |
#if ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC)) |
| 23 |
# define RBIMPL_COMPILER_IS_SunPro 0 |
| 24 |
|
| 25 |
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x5100 |
| 26 |
# define RBIMPL_COMPILER_IS_SunPro 1 |
| 27 |
# /* __SUNPRO_C = 0xXYYZ */ |
| 28 |
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 12) |
| 29 |
# define RBIMPL_COMPILER_VERSION_MINOR ((__SUNPRO_C >> 8 & 0xF) * 10 + (__SUNPRO_C >> 4 & 0xF)) |
| 30 |
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF) |
| 31 |
|
| 32 |
#elif defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5100 |
| 33 |
# define RBIMPL_COMPILER_IS_SunPro 1 |
| 34 |
# /* __SUNPRO_CC = 0xXYYZ */ |
| 35 |
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 12) |
| 36 |
# define RBIMPL_COMPILER_VERSION_MINOR ((__SUNPRO_CC >> 8 & 0xF) * 10 + (__SUNPRO_CC >> 4 & 0xF)) |
| 37 |
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF) |
| 38 |
|
| 39 |
#elif defined(__SUNPRO_C) |
| 40 |
# define RBIMPL_COMPILER_IS_SunPro 1 |
| 41 |
# /* __SUNPRO_C = 0xXYZ */ |
| 42 |
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 8) |
| 43 |
# define RBIMPL_COMPILER_VERSION_MINOR (__SUNPRO_C >> 4 & 0xF) |
| 44 |
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF) |
| 45 |
|
| 46 |
#else |
| 47 |
# define RBIMPL_COMPILER_IS_SunPro 1 |
| 48 |
# /* __SUNPRO_CC = 0xXYZ */ |
| 49 |
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 8) |
| 50 |
# define RBIMPL_COMPILER_VERSION_MINOR (__SUNPRO_CC >> 4 & 0xF) |
| 51 |
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF) |
| 52 |
#endif |
| 53 |
|
| 54 |
#endif /* RBIMPL_COMPILER_IS_SUNPRO_H */ |