PER visible constraints are used to select the native representation for INTEGER types


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@957 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1compiler/asn1c_constraint.c b/libasn1compiler/asn1c_constraint.c
index d75313d..372730f 100644
--- a/libasn1compiler/asn1c_constraint.c
+++ b/libasn1compiler/asn1c_constraint.c
@@ -62,6 +62,9 @@
 	switch(etype) {
 	case ASN_BASIC_INTEGER:
 	case ASN_BASIC_ENUMERATED:
+		if(asn1c_type_fits_long(arg, arg->expr) == FL_NOTFIT)
+			produce_st = 1;
+		break;
 	case ASN_BASIC_REAL:
 		if(!(arg->flags & A1C_USE_NATIVE_TYPES))
 			produce_st = 1;
@@ -556,7 +559,7 @@
 	switch(etype) {
 	case ASN_BASIC_INTEGER:
 	case ASN_BASIC_ENUMERATED:
-		if(arg->flags & A1C_USE_NATIVE_TYPES) {
+		if(asn1c_type_fits_long(arg, arg->expr) != FL_NOTFIT) {
 			OUT("value = *(const long *)sptr;\n");
 		} else {
 			if(r_value->el_count == 0