- Fixed: Visual C++ 6.0 does not have _get_pgmptr(). You just access the variable directly with that version.

- Silenced some conversion warnings made by VC++ 6.
- Added the current working directory (.) as an automatic include directory, just ahead of
  the program directory, for compatibility with older ACCs that had no include path handling.

SVN r2016 (trunk)
This commit is contained in:
Randy Heit 2009-12-04 01:15:08 +00:00
parent 35632f91fe
commit 0dcf40afe6
3 changed files with 12 additions and 5 deletions

1
acc.c
View file

@ -243,6 +243,7 @@ static void ProcessArgs(void)
DisplayUsage();
}
TK_AddIncludePath(".");
TK_AddProgramIncludePath(ArgVector[0]);
if(count == 1)

10
parse.c
View file

@ -1700,8 +1700,8 @@ static void LeadingFunction()
}
else
{
PC_AppendByte(argCount);
PC_AppendWord(specialValue);
PC_AppendByte((U_BYTE)argCount);
PC_AppendWord((U_WORD)specialValue);
}
PC_AppendCmd(PCD_DROP);
TK_NextToken();
@ -3304,7 +3304,7 @@ static void ExprLineSpecial(void)
}
else
{
PC_AppendByte(specialValue);
PC_AppendByte((U_BYTE)specialValue);
}
}
else
@ -3319,8 +3319,8 @@ static void ExprLineSpecial(void)
}
else
{
PC_AppendByte(argCount);
PC_AppendWord(-specialValue);
PC_AppendByte((U_BYTE)argCount);
PC_AppendWord((U_WORD)-specialValue);
}
}
}

View file

@ -332,6 +332,7 @@ void TK_AddIncludePath(char *sourcePath)
// Add a directory delimiter to the include path
strcat(IncludePaths[NumIncludePaths], "/");
}
MS_Message(MSG_DEBUG, "Add include path %d: \"%s\"\n", NumIncludePaths, IncludePaths[NumIncludePaths]);
NumIncludePaths++;
}
}
@ -349,10 +350,14 @@ void TK_AddProgramIncludePath(char *progname)
{
#ifdef _WIN32
#ifdef _MSC_VER
#if _MSC_VER >= 1300
if (_get_pgmptr(&progname) != 0)
{
return;
}
#else
progname = _pgmptr;
#endif
#else
char progbuff[1024];
GetModuleFileName(0, progbuff, sizeof(progbuff));
@ -369,6 +374,7 @@ void TK_AddProgramIncludePath(char *progname)
strcpy(IncludePaths[NumIncludePaths], progname);
if(MS_StripFilename(IncludePaths[NumIncludePaths]))
{
MS_Message(MSG_DEBUG, "Program include path is %d: \"%s\"\n", NumIncludePaths, IncludePaths[NumIncludePaths]);
NumIncludePaths++;
}
}