glr.cc: avoid compiler warnings

381. types.at:366: testing glr.cc api.value.type={double} ...
    test.cc:207:57: error: "__clang_major__" is not defined, evaluates to 0 [-Werror=undef]
      207 | #if defined __APPLE__ && YY_CPLUSPLUS < 201103L && 4 <= __clang_major__
          |                                                         ^~~~~~~~~~~~~~~

* data/skeletons/glr.cc: Check __clang_major__ before using it.
This commit is contained in:
Akim Demaille
2019-12-17 06:37:47 +01:00
parent 139d065594
commit b10366f296

View File

@@ -267,7 +267,8 @@ b4_percent_code_get([[requires]])[
// On MacOS, PTRDIFF_MAX is defined as long long, which Clang's
// -pedantic reports as being a C++11 extension.
#if defined __APPLE__ && YY_CPLUSPLUS < 201103L && 4 <= __clang_major__
#if defined __APPLE__ && YY_CPLUSPLUS < 201103L \
&& defined __clang__ && 4 <= __clang_major__
# pragma clang diagnostic ignored "-Wc++11-long-long"
#endif