Skip to content

Commit

Permalink
optionally allow ORANGE_NAMES_WITH_DOTS
Browse files Browse the repository at this point in the history
  • Loading branch information
rochus-keller committed May 12, 2024
1 parent 7921ce8 commit 2e49fd7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BUSY
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let config : Config {

let config2 : Config {
.include_dirs += [ . ./src/occopt ./src/util ./src/ocpp ]
.defines += [ "ORANGE_NO_MSIL" "ORANGE_NO_INASM" ]
.defines += [ "ORANGE_NO_MSIL" "ORANGE_NO_INASM" "ORANGE_NAMES_WITH_DOTS" ]
}

let common : SourceSet {
Expand Down
6 changes: 4 additions & 2 deletions src/occopt/optmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ void examine_icode(QUAD* head)
{
switch (architecture)
{
case ARCHITECTURE_MSIL:
#ifndef ORANGE_NO_MSIL
case ARCHITECTURE_MSIL:
msil_examine_icode(head);
break;
#endif
case ARCHITECTURE_X86:
x86_examine_icode(head);
break;
Expand Down Expand Up @@ -565,4 +567,4 @@ int main(int argc, char* argv[])
printf("occopt timing: %d.%03d\n", (stopTime - startTime) / 1000, (stopTime - startTime) % 1000);
}
return 0;
}
}
2 changes: 2 additions & 0 deletions src/occparse/occparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ int main(int argc, char* argv[])
{
CompletionCompiler::ccNewFile(buffer, true);
}
#ifndef ORANGE_NAMES_WITH_DOTS
Utils::AddExt(buffer, ".C");
#endif
if (prm_std.GetExists())
{
if (prm_std.GetValue() == "c89")
Expand Down
4 changes: 4 additions & 0 deletions src/occparse/osutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,9 @@ void InsertOneFile(const char* filename, char* path, int drive)
buffer[0] = a;
if (!inserted)
{
#ifndef ORANGE_NAMES_WITH_DOTS
Utils::AddExt(buffer, ".c");
#endif
newbuffer = (char*)malloc(strlen(buffer) + 1);
if (!newbuffer)
return;
Expand Down Expand Up @@ -1103,7 +1105,9 @@ void outputfile(char* buf, const char* orgbuf, const char* ext)
}
else if (prm_output.GetExists() && !MakeStubsContinue.GetValue() && !MakeStubsContinueUser.GetValue())
{
#ifndef ORANGE_NAMES_WITH_DOTS
Utils::AddExt(buf, ext);
#endif
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions src/util/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,10 @@ FILE* Utils::TempName(std::string& name)
*/
void Utils::AddExt(char* buffer, const char* ext)
{
#ifndef ORANGE_NAMES_WITH_DOTS
char* pos = (char*)strrchr(buffer, '.');
if (!pos || (*(pos - 1) == '.') || (*(pos + 1) == '\\'))
#endif
strcat(buffer, ext);
}

Expand Down

0 comments on commit 2e49fd7

Please sign in to comment.