Compiler fixes for MinGW.

In MinGW, when parameters are passed to vhdlpp by ivlpp, single quotes
are treated as ordinary characters. Use double quotes instead, as is
done in the driver.

Also, MinGW does not have a standard mkdir() function, so we need to
convert calls to mkdir() into calls to _mkdir().
This commit is contained in:
Martin Whitaker 2011-11-02 20:09:42 +00:00 committed by Stephen Williams
parent d2dc0e535f
commit 58d182bdf3
2 changed files with 6 additions and 2 deletions

View File

@ -1795,14 +1795,14 @@ static void open_input_file(struct include_stack_t*isp)
for (idx = 0 ; idx < vhdlpp_libdir_cnt ; idx += 1) {
size_t next_len = 6 + strlen(vhdlpp_libdir[idx]);
libs = realloc(libs, liblen+next_len);
snprintf(libs+liblen-1, next_len, " -L'%s'", vhdlpp_libdir[idx]);
snprintf(libs+liblen-1, next_len, " -L\"%s\"", vhdlpp_libdir[idx]);
liblen = strlen(libs) + 1;
}
cmdlen += liblen;
char*cmd = malloc(cmdlen);
snprintf(cmd, cmdlen, "%s -w'%s'%s %s", vhdlpp_path, vhdlpp_work, libs, isp->path);
snprintf(cmd, cmdlen, "%s -w\"%s\"%s %s", vhdlpp_path, vhdlpp_work, libs, isp->path);
if (verbose_flag)
fprintf(stderr, "Invoke vhdlpp: %s\n", cmd);

View File

@ -81,6 +81,10 @@ const char NOTICE[] =
# include <getopt.h>
#endif
# include <sys/stat.h>
#if defined(__MINGW32__)
# include <io.h>
# define mkdir(path, mode) _mkdir(path)
#endif
bool verbose_flag = false;