preproc: Fix macro definition lines being offset by 1

This is most noticeable in preprocessor messages involving the
definition location of a macro (redefine warning, argument mismatch
errors). The preprocessor_data linenum_ variable never starts at zero as
far as I can tell.
This commit is contained in:
Ignacio R. Morelle 2015-08-18 03:22:53 -03:00
parent 987bb787ce
commit c36bb4c5d0
2 changed files with 3 additions and 1 deletions

View file

@ -38,6 +38,8 @@ Version 1.13.1+dev:
show/hide them
* The WML preprocessor now writes warnings to stderr for macros redefined
without #undef, to help detect unintentional name clashes.
* Fix macro definition line numbers being offset by 1 in WML preprocessor
messages involving macros.
* Editor:
* Added Category field and color sliders to the Edit Label panel.
* Miscellaneous and bug fixes:

View file

@ -903,7 +903,7 @@ bool preprocessor_data::get_chunk()
buffer.erase(buffer.end() - 7, buffer.end());
(*target_.defines_)[symbol] = preproc_define(buffer, items, target_.textdomain_,
linenum + 1, target_.location_);
linenum, target_.location_);
LOG_PREPROC << "defining macro " << symbol << " (location " << get_location(target_.location_) << ")\n";
}
} else if (command == "ifdef") {