diff options
author | Abseil Team <absl-team@google.com> | 2019-11-19T22·43-0800 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-11-20T19·18-0500 |
commit | 8ba96a8244bbe334d09542e92d566673a65c1f78 (patch) | |
tree | d3b3c935d847a9320acefdf13b3b10755f9351d2 /absl | |
parent | 2103fd9acdf58279f739860bff3f8c9f4b845605 (diff) |
Export of internal Abseil changes
-- 87f85071a96c6d10f471cdf8a8c2d6c550c926e0 by Matt Kulukundis <kfm@google.com>: Expose ABSL_HAVE_SOURCE_LOCATION_CURRENT as a public api. PiperOrigin-RevId: 281383411 GitOrigin-RevId: 87f85071a96c6d10f471cdf8a8c2d6c550c926e0 Change-Id: I4dfc18a5ba8e064bf9b749892aa8293470459e6b
Diffstat (limited to 'absl')
-rw-r--r-- | absl/base/config.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/absl/base/config.h b/absl/base/config.h index 46a84f1a76f6..556b186cb94f 100644 --- a/absl/base/config.h +++ b/absl/base/config.h @@ -85,6 +85,12 @@ #define ABSL_HAVE_BUILTIN(x) 0 #endif +#if defined(__is_identifier) +#define ABSL_INTERNAL_HAS_KEYWORD(x) !(__is_identifier(x)) +#else +#define ABSL_INTERNAL_HAS_KEYWORD(x) 0 +#endif + // ABSL_HAVE_TLS is defined to 1 when __thread should be supported. // We assume __thread is supported on Linux when compiled with Clang or compiled // against libstdc++ with _GLIBCXX_HAVE_TLS defined. @@ -133,6 +139,17 @@ #define ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1 #endif +// ABSL_HAVE_SOURCE_LOCATION_CURRENT +// +// Indicates whether `absl::SourceLocation::current()` will return useful +// information in some contexts. +#ifndef ABSL_HAVE_SOURCE_LOCATION_CURRENT +#if ABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \ + ABSL_INTERNAL_HAS_KEYWORD(__builtin_FILE) +#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 +#endif +#endif + // ABSL_HAVE_THREAD_LOCAL // // Checks whether C++11's `thread_local` storage duration specifier is @@ -539,4 +556,6 @@ #define ABSL_INTERNAL_MSVC_2017_DBG_MODE #endif +#undef ABSL_INTERNAL_HAS_KEYWORD + #endif // ABSL_BASE_CONFIG_H_ |