From 58d182bdf34fe2b4004801527013d4d09fcc1702 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 2 Nov 2011 20:09:42 +0000 Subject: [PATCH] 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(). --- ivlpp/lexor.lex | 4 ++-- vhdlpp/main.cc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index 2e054ee90..348f78ba3 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -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); diff --git a/vhdlpp/main.cc b/vhdlpp/main.cc index 0cadb31ce..7901b699e 100644 --- a/vhdlpp/main.cc +++ b/vhdlpp/main.cc @@ -81,6 +81,10 @@ const char NOTICE[] = # include #endif # include +#if defined(__MINGW32__) +# include +# define mkdir(path, mode) _mkdir(path) +#endif bool verbose_flag = false;