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, ...@@ -291,8 +291,8 @@ NativeReal_encode_oer(asn_TYPE_descriptor_t *td,
* That was the whole point of compact encoding! * That was the whole point of compact encoding!
*/ */
} else { } else {
assert(wire_size == sizeof(double) assert((wire_size == sizeof(double))
|| specs && specs->float_size == wire_size); || (specs && specs->float_size == wire_size));
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
} }
...@@ -540,7 +540,6 @@ NativeReal_free(const asn_TYPE_descriptor_t *td, void *ptr, ...@@ -540,7 +540,6 @@ NativeReal_free(const asn_TYPE_descriptor_t *td, void *ptr,
} }
} }
asn_random_fill_result_t asn_random_fill_result_t
NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints, const asn_encoding_constraints_t *constraints,
...@@ -548,6 +547,12 @@ NativeReal_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, ...@@ -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_ok = {ARFILL_OK, 0};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 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[] = { static const double values[] = {
0, -0.0, -1, 1, -M_E, M_E, -3.14, 3.14, -M_PI, M_PI, -255, 255, 0, -0.0, -1, 1, -M_E, M_E, -3.14, 3.14, -M_PI, M_PI, -255, 255,
/* 2^51 */ /* 2^51 */
......
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
#ifndef _BSD_SOURCE #ifndef _BSD_SOURCE
#define _BSD_SOURCE /* To reintroduce finite(3) */ #define _BSD_SOURCE /* To reintroduce finite(3) */
#endif #endif
#include <asn_internal.h>
#if defined(__alpha) #if defined(__alpha)
#include <sys/resource.h> /* For INFINITY */ #include <sys/resource.h> /* For INFINITY */
#endif #endif
#include <asn_internal.h> #if defined(sun) || defined(__sun)
#include <ieeefp.h>
#endif
#include <stdlib.h> /* for strtod(3) */ #include <stdlib.h> /* for strtod(3) */
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>
...@@ -24,10 +27,10 @@ ...@@ -24,10 +27,10 @@
static volatile double real_zero CC_NOTUSED = 0.0; static volatile double real_zero CC_NOTUSED = 0.0;
#endif #endif
#ifndef NAN #ifndef NAN
#define NAN (real_zero/real_zero) #define NAN (0.0/0.0)
#endif #endif
#ifndef INFINITY #ifndef INFINITY
#define INFINITY (1.0/real_zero) #define INFINITY (1.0/0.0)
#endif #endif
#if defined(__clang__) #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