Merge pull request #393 from haberman/has-attribute

Fixed the __has_attribute() check for old versions of Clang.
pull/13171/head
Joshua Haberman 4 years ago committed by GitHub
commit aaad7801bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      upb/port_def.inc

@ -167,12 +167,20 @@
/* Configure whether fasttable is switched on or not. *************************/
#if defined(__clang__) && __has_attribute(musttail)
#ifdef __has_attribute
#define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
#else
#define UPB_HAS_ATTRIBUTE(x) 0
#endif
#if UPB_HAS_ATTRIBUTE(musttail)
#define UPB_MUSTTAIL __attribute__((musttail))
#else
#define UPB_MUSTTAIL
#endif
#undef UPB_HAS_ATTRIBUTE
/* This check is not fully robust: it does not require that we have "musttail"
* support available. We need tail calls to avoid consuming arbitrary amounts
* of stack space.

Loading…
Cancel
Save