Commit 4c97bd61 authored by Lev Walkin's avatar Lev Walkin

some platforms don't have INTxx_MIN

parent 0f5d74c6
...@@ -257,9 +257,12 @@ asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) { ...@@ -257,9 +257,12 @@ asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) {
* Since we don't know the sizeof(long) on the possible target platform * Since we don't know the sizeof(long) on the possible target platform
* which will be compiling the code generated by asn1c, let's play it * which will be compiling the code generated by asn1c, let's play it
* simple: long's range is equal to or greater than int32_t. * simple: long's range is equal to or greater than int32_t.
* NOTE: the most negative integer cannot be written in C, as the C99
* standard will give it an unsigned type.
* It is defined here as a constant expression.
*/ */
#define LEFTMIN INT32_MIN #define LEFTMIN 2147483647
#define RIGHTMAX INT32_MAX #define RIGHTMAX (-LEFTMIN-1)
/* Descend to the terminal type */ /* Descend to the terminal type */
expr = asn1f_find_terminal_type_ex(arg->asn, expr); expr = asn1f_find_terminal_type_ex(arg->asn, expr);
......
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