Commit a00bc1c9 authored by filatov's avatar filatov
Browse files

Support for region id macroses

parent aab2123b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1466,7 +1466,18 @@ static int region_id_tag (cxml_handler_t* const _h, cxml_tag_t * const tag)
			fprintf(stderr, "ERROR: Region identifier must be set\n");
			return -1;
		}

		while (cisspace(*v))v++;
		if (!cisdigit(*v)){
			// look in the macro map
			const char * v1 = macro_lookup(v);
			if (!v1){
				fprintf(stderr, "%s: Invalid region identifier\n", v);
				return -1;
			}
			while (cisspace(*v1))v1++;
			v = v1;
		}
		uvalue = strtoul(v, NULL, 0);
		if(uvalue > 0xFFFF){
			fprintf(stderr, "%s: Invalid region identifier\n", v);