-
Notifications
You must be signed in to change notification settings - Fork 543
ucs: portability fixes for non-glibc / Clang environments #11354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,6 @@ | |
| #define UCS_F_NOOPTIMIZE | ||
| #endif | ||
|
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove line change |
||
| /** | ||
| * Copy words from _src to _dst. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,8 @@ | |
| #include <net/if.h> | ||
| #include <netdb.h> | ||
| #include <dirent.h> | ||
| #include <limits.h> | ||
| #include <unistd.h> | ||
|
|
||
|
|
||
| #include <sys/types.h> | ||
|
|
@@ -63,6 +65,16 @@ typedef cpuset_t ucs_sys_cpuset_t; | |
| #error "Port me" | ||
| #endif | ||
|
|
||
| #ifdef HOST_NAME_MAX | ||
| #define UCS_HOST_NAME_MAX HOST_NAME_MAX | ||
| #else | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #elif defined() |
||
| #ifdef _POSIX_HOST_NAME_MAX | ||
| #define UCS_HOST_NAME_MAX _POSIX_HOST_NAME_MAX | ||
| #else | ||
| #define UCS_HOST_NAME_MAX 256 | ||
| #endif | ||
| #endif | ||
|
|
||
| #define UCS_SYS_FS_SYSTEM_PATH "/sys/devices/system" | ||
| #define UCS_SYS_FS_CPUS_PATH UCS_SYS_FS_SYSTEM_PATH "/cpu" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,28 @@ | |
| #ifndef UCS_TYPE_FLOAT_H | ||
| #define UCS_TYPE_FLOAT_H | ||
|
|
||
| #ifdef HAVE_IEEE754_H | ||
| #include <ieee754.h> | ||
|
tvegas1 marked this conversation as resolved.
|
||
| #else | ||
| /* Portable fallback for systems without <ieee754.h> (non-glibc, e.g. musl, FreeBSD libc) */ | ||
| union ieee754_double { | ||
| double d; | ||
| struct { | ||
| #if defined(FLOAT_WORDS_BIGENDIAN) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #if __BYTE_ORDER == __BIG_ENDIAN |
||
| unsigned int negative:1; | ||
| unsigned int exponent:11; | ||
| unsigned int mantissa0:20; | ||
| unsigned int mantissa1:32; | ||
| #else | ||
| unsigned int mantissa1:32; | ||
| unsigned int mantissa0:20; | ||
| unsigned int exponent:11; | ||
| unsigned int negative:1; | ||
| #endif | ||
| } ieee; | ||
| }; | ||
| #define IEEE754_DOUBLE_BIAS 0x3ff | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can remove? |
||
| #endif | ||
|
|
||
| #include <ucs/sys/preprocessor.h> | ||
| #include <ucs/debug/assert.h> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.