Merge pull request #225 from JuliaMath/vs/strict_assign

Restore STRICT_ASSIGN on FreeBSD as suggested in #215
This commit is contained in:
Viral B. Shah 2021-02-06 18:09:23 -05:00 committed by GitHub
commit 6a85b33182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,10 +203,9 @@ do { \
} while (0) } while (0)
//VBS #ifndef __FreeBSD__
#define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval)) #define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
#else
/* VBS
#ifdef FLT_EVAL_METHOD #ifdef FLT_EVAL_METHOD
// Attempt to get strict C99 semantics for assignment with non-C99 compilers. // Attempt to get strict C99 semantics for assignment with non-C99 compilers.
#if FLT_EVAL_METHOD == 0 || __GNUC__ == 0 #if FLT_EVAL_METHOD == 0 || __GNUC__ == 0
@ -215,7 +214,7 @@ do { \
#define STRICT_ASSIGN(type, lval, rval) do { \ #define STRICT_ASSIGN(type, lval, rval) do { \
volatile type __lval; \ volatile type __lval; \
\ \
if (sizeof(type) >= sizeof(double)) \ if (sizeof(type) >= sizeof(long double)) \
(lval) = (rval); \ (lval) = (rval); \
else { \ else { \
__lval = (rval); \ __lval = (rval); \
@ -224,7 +223,7 @@ do { \
} while (0) } while (0)
#endif #endif
#endif #endif
*/ #endif
/* /*
* Common routine to process the arguments to nan(), nanf(), and nanl(). * Common routine to process the arguments to nan(), nanf(), and nanl().