mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-02 16:18:44 +00:00
Try fixing __has_attribute errors on Travis macOS
This commit is contained in:
parent
80610addf8
commit
f854e3dc29
1 changed files with 13 additions and 13 deletions
|
@ -66,18 +66,18 @@ char *tparm_solaris_kludge(char *str, long p1 = 0, long p2 = 0, long p3 = 0, lon
|
||||||
long p5 = 0, long p6 = 0, long p7 = 0, long p8 = 0, long p9 = 0);
|
long p5 = 0, long p6 = 0, long p7 = 0, long p8 = 0, long p9 = 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// On OS X, use weak linking for wcsdup and wcscasecmp. Weak linking allows you to call the
|
// On OS X, use weak linking for wcsdup and wcscasecmp. Weak linking allows you to call the
|
||||||
/// function only if it exists at runtime. You can detect it by testing the function pointer against
|
// function only if it exists at runtime. You can detect it by testing the function pointer against
|
||||||
/// NULL. To avoid making the callers do that, redefine wcsdup to wcsdup_use_weak, and likewise with
|
// NULL. To avoid making the callers do that, redefine wcsdup to wcsdup_use_weak, and likewise with
|
||||||
/// wcscasecmp. This lets us use the same binary on SnowLeopard (10.6) and Lion+ (10.7), even though
|
// wcscasecmp. This lets us use the same binary on SnowLeopard (10.6) and Lion+ (10.7), even though
|
||||||
/// these functions only exist on 10.7+.
|
// these functions only exist on 10.7+.
|
||||||
///
|
//
|
||||||
/// On other platforms, use what's detected at build time.
|
// On other platforms, use what's detected at build time.
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#if __DARWIN_C_LEVEL >= 200809L && __has_attribute(clang::weak_import)
|
// Avoid warnings about unknown `clang::weak_import` attribute (e.g. GCC 8.2.0 on macOS 10.10)
|
||||||
// We have to explicitly redeclare these as weak,
|
#if __DARWIN_C_LEVEL >= 200809L && __clang__ && __has_attribute(weak_import)
|
||||||
// since we are forced to set the MIN_REQUIRED availability macro to 10.7
|
// We have to explicitly redeclare these as weak, since we are forced to set the MIN_REQUIRED
|
||||||
// to use libc++, which in turn exposes these as strong
|
// availability macro to 10.7 to use libc++, which in turn exposes these as strong
|
||||||
[[clang::weak_import]] wchar_t *wcsdup(const wchar_t *);
|
[[clang::weak_import]] wchar_t *wcsdup(const wchar_t *);
|
||||||
[[clang::weak_import]] int wcscasecmp(const wchar_t *, const wchar_t *);
|
[[clang::weak_import]] int wcscasecmp(const wchar_t *, const wchar_t *);
|
||||||
[[clang::weak_import]] int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
|
[[clang::weak_import]] int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
|
||||||
|
@ -92,8 +92,8 @@ wchar_t *wcsdup(const wchar_t *in);
|
||||||
int wcscasecmp(const wchar_t *a, const wchar_t *b);
|
int wcscasecmp(const wchar_t *a, const wchar_t *b);
|
||||||
int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
||||||
wchar_t *wcsndup(const wchar_t *in, size_t c);
|
wchar_t *wcsndup(const wchar_t *in, size_t c);
|
||||||
#endif
|
#endif // clang::weak_import
|
||||||
#else //__APPLE__
|
#else // __APPLE__
|
||||||
|
|
||||||
/// These functions are missing from Solaris 10, and only accessible from
|
/// These functions are missing from Solaris 10, and only accessible from
|
||||||
/// Solaris 11 in the std:: namespace.
|
/// Solaris 11 in the std:: namespace.
|
||||||
|
|
Loading…
Reference in a new issue