| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -538,15 +538,15 @@ extern "C" { | |||
| 538 | 538 | // | |
| 539 | 539 | // Example: _Py_TYPEOF(x) x_copy = (x); | |
| 540 | 540 | // | |
| 541 | - // On C23, use typeof(). Otherwise __typeof__() if on GCC, clang or | ||
| 542 | - // MSVC 17.9 and newer. Else if on C++11 or newer, decltype() is used. | ||
| 541 | + // On C23, use typeof(). On C++11, use decltype(). Otherwise, use __typeof__() | ||
| 542 | + // if on GCC, clang or MSVC 17.9 and newer. | ||
| 543 | 543 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | |
| 544 | 544 | # define _Py_TYPEOF(expr) typeof(expr) | |
| 545 | + #elif defined(__cplusplus) && __cplusplus >= 201103L | ||
| 546 | + # define _Py_TYPEOF(expr) decltype(expr) | ||
| 545 | 547 | #elif defined(__GNUC__) || defined(__clang__) || \ | |
| 546 | 548 | (defined(_MSC_VER) && _MSC_VER >= 1939) | |
| 547 | 549 | # define _Py_TYPEOF(expr) __typeof__(expr) | |
| 548 | - #elif defined(__cplusplus) && __cplusplus >= 201103L | ||
| 549 | - # define _Py_TYPEOF(expr) decltype(expr) | ||
| 550 | 550 | #endif | |
| 551 | 551 | ||
| 552 | 552 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments