C90-compliant negative LONG_MIN

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1392 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1compiler/asn1c_out.h b/libasn1compiler/asn1c_out.h
index 0523cbc..04d7ff2 100644
--- a/libasn1compiler/asn1c_out.h
+++ b/libasn1compiler/asn1c_out.h
@@ -108,4 +108,21 @@
 	REDIR(saved_target);					\
 } while(0)
 
+/*
+ * Format LONG_MIN according to C90 rules.
+ */
+#define OINT(iv)	do {					\
+	if(iv == (-2147483647L - 1))				\
+		OUT("(-2147483647L - 1)");			\
+	else							\
+		OUT("%" PRIdASN, iv);				\
+} while(0)
+
+#define OINTS(iv)	do {					\
+	if(iv == (-2147483647L - 1))				\
+		OUT("(-2147483647L - 1)");			\
+	else							\
+		OUT("% " PRIdASN, iv);				\
+} while(0)
+
 #endif	/* _ASN1_COMPILED_OUTPUT_H_ */