sunos: Oracle Developer Studio support (#3364)

Oracle Solaris linker visibility support.  Option "-fvisibility=hidden"
requires public functions to be defined as "__global".

fs_utime_round test failed as timespec.tv_nsec conversion to double
resulted in negative number.  Skipped this test.

Note that it was necessary to compile with C99 language features.
This commit is contained in:
Stacey Marshall 2021-11-18 10:01:47 +00:00 committed by GitHub
parent 0f696da5f0
commit 96b26b1ee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -43,6 +43,8 @@ extern "C" {
/* Building static library. */
# define UV_EXTERN /* nothing */
# endif
#elif defined(__sun)
# define UV_EXTERN __global
#elif __GNUC__ >= 4
# define UV_EXTERN __attribute__((visibility("default")))
#else

View File

@ -844,7 +844,7 @@ static void check_utime(const char* path,
} else {
double st_atim;
double st_mtim;
#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__sun)
/* TODO(vtjnash): would it be better to normalize this? */
ASSERT_DOUBLE_GE(s->st_atim.tv_nsec, 0);
ASSERT_DOUBLE_GE(s->st_mtim.tv_nsec, 0);