1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

Introjucer: added a header-guard to the binarydata files that are generated

This commit is contained in:
jules 2013-12-11 21:33:03 +00:00
parent f475dcfdb6
commit 9bba8bae5e
11 changed files with 2384 additions and 3085 deletions

View file

@ -128,8 +128,13 @@ static String getComment()
bool ResourceFile::writeHeader (MemoryOutputStream& header)
{
const String headerGuard ("BINARYDATA_H_" + String (project.getProjectUID().hashCode() & 0x7ffffff) + "_INCLUDED");
header << "/* ========================================================================================="
<< getComment()
<< "#ifndef " << headerGuard << newLine
<< "#define " << headerGuard << newLine
<< newLine
<< "namespace " << className << newLine
<< "{" << newLine;
@ -163,7 +168,9 @@ bool ResourceFile::writeHeader (MemoryOutputStream& header)
<< " // If you provide the name of one of the binary resource variables above, this function will" << newLine
<< " // return the corresponding data and its size (or a null pointer if the name isn't found)." << newLine
<< " const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();" << newLine
<< "}" << newLine;
<< "}" << newLine
<< newLine
<< "#endif" << newLine;
return true;
}