From d6e0e07943e9a5af5703a4d5e29864cb0bbd0e43 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 15 Apr 2024 19:10:09 +0800 Subject: [PATCH] - fix: Name of the macro for project private resource header is not correct. --- NEWS.md | 1 + RedPandaIDE/project.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 727059c3..c98a1927 100644 --- a/NEWS.md +++ b/NEWS.md @@ -145,6 +145,7 @@ Red Panda C++ Version 2.27 - enhancement: sdcc project compiler: compile source file in subfolders. - fix: project options -> compiler set -> static link & auto convert charset options not correctly loaded. - change: Don't generate project resource files for sdcc project. + - fix: Name of the macro for project private resource header is not correct. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 315cf4dd..091b1e13 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -1581,8 +1581,11 @@ void Project::buildPrivateResource() // create private header file QString hFile = changeFileExt(rcFile, H_EXT); contents.clear(); - QString def = extractFileName(rcFile); + QString def = extractFileName(hFile); def.replace(".","_"); + def = def.toUpper(); + if (def.front().isDigit()) + def = "PROJECT_"+def; contents.append("/* THIS FILE WILL BE OVERWRITTEN BY Red Panda C++ */"); contents.append("/* DO NOT EDIT ! */"); contents.append("");