1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

__DATE__ should have day prefixed with space

The documentation for GCC, and other compilers, stipulates that
__DATE__ with a day of month less than 10 should be prefixed by a space,
not a zero.

Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2024-08-29 21:14:02 +02:00 committed by Torbjorn-Svensson
parent 78d9a35bdd
commit 3b6f1359f0

View file

@ -36,7 +36,11 @@ public final class DateMacro extends DynamicMacro {
DateFormatSymbols dfs = new DateFormatSymbols();
buffer.append(dfs.getShortMonths()[cal.get(Calendar.MONTH)]);
buffer.append(" "); //$NON-NLS-1$
append(buffer, cal.get(Calendar.DAY_OF_MONTH));
int dom = cal.get(Calendar.DAY_OF_MONTH);
if (dom < 10) {
buffer.append(" "); //$NON-NLS-1$
}
buffer.append(dom);
buffer.append(" "); //$NON-NLS-1$
buffer.append(cal.get(Calendar.YEAR));
buffer.append("\""); //$NON-NLS-1$