From 3b6f1359f0d518c4225086bcd3de82f8f921ea4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Date: Thu, 29 Aug 2024 21:14:02 +0200 Subject: [PATCH] __DATE__ should have day prefixed with space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../eclipse/cdt/internal/core/parser/scanner/DateMacro.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DateMacro.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DateMacro.java index 2bf8baa9eaa..2aba20a48c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DateMacro.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DateMacro.java @@ -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$