Commit fe374310 authored by Lev Walkin's avatar Lev Walkin

sun compatibility

parent 9d6ba1c8
......@@ -291,8 +291,8 @@ NativeReal_encode_oer(asn_TYPE_descriptor_t *td,
* That was the whole point of compact encoding!
*/
} else {
assert(wire_size == sizeof(double)
|| specs && specs->float_size == wire_size);
assert((wire_size == sizeof(double))
|| (specs && specs->float_size == wire_size));
ASN__ENCODE_FAILED;
}
......@@ -540,7 +540,6 @@ NativeReal_free(const asn_TYPE_descriptor_t *td, void *ptr,
}
}
asn_random_fill_result_t
NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
......@@ -548,6 +547,12 @@ NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
asn_random_fill_result_t result_ok = {ARFILL_OK, 0};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
#ifndef INFINITY
#define INFINITY (1.0/0.0)
#endif
#ifndef NAN
#define NAN (0.0/0.0)
#endif
static const double values[] = {
0, -0.0, -1, 1, -M_E, M_E, -3.14, 3.14, -M_PI, M_PI, -255, 255,
/* 2^51 */
......
......@@ -6,10 +6,13 @@
#ifndef _BSD_SOURCE
#define _BSD_SOURCE /* To reintroduce finite(3) */
#endif
#include <asn_internal.h>
#if defined(__alpha)
#include <sys/resource.h> /* For INFINITY */
#endif
#include <asn_internal.h>
#if defined(sun) || defined(__sun)
#include <ieeefp.h>
#endif
#include <stdlib.h> /* for strtod(3) */
#include <math.h>
#include <float.h>
......@@ -24,10 +27,10 @@
static volatile double real_zero CC_NOTUSED = 0.0;
#endif
#ifndef NAN
#define NAN (real_zero/real_zero)
#define NAN (0.0/0.0)
#endif
#ifndef INFINITY
#define INFINITY (1.0/real_zero)
#define INFINITY (1.0/0.0)
#endif
#if defined(__clang__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment