From 0dcf40afe62d3b85238a13381dd7e79beb4b0a02 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 4 Dec 2009 01:15:08 +0000 Subject: [PATCH] - 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) --- acc.c | 1 + parse.c | 10 +++++----- token.c | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/acc.c b/acc.c index 2349cd9..4349f25 100644 --- a/acc.c +++ b/acc.c @@ -243,6 +243,7 @@ static void ProcessArgs(void) DisplayUsage(); } + TK_AddIncludePath("."); TK_AddProgramIncludePath(ArgVector[0]); if(count == 1) diff --git a/parse.c b/parse.c index b0b923b..981dee1 100644 --- a/parse.c +++ b/parse.c @@ -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); } } } diff --git a/token.c b/token.c index 92284f5..2192e8a 100644 --- a/token.c +++ b/token.c @@ -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++; } }