some platforms don't have INTxx_MIN

diff --git a/libasn1compiler/asn1c_misc.c b/libasn1compiler/asn1c_misc.c
index 35de213..c8cd2e7 100644
--- a/libasn1compiler/asn1c_misc.c
+++ b/libasn1compiler/asn1c_misc.c
@@ -257,9 +257,12 @@
  * 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
  * 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	RIGHTMAX	INT32_MAX
+#define	LEFTMIN		2147483647
+#define	RIGHTMAX	(-LEFTMIN-1)
 
 	/* Descend to the terminal type */
 	expr = asn1f_find_terminal_type_ex(arg->asn, expr);