Skip to content

Commit

Permalink
Use __BASE_FILE__ instead of __FILE__ since __LINE__ messes up __FILE__
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17605 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 8, 2013
1 parent d207124 commit 516d007
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Compiler/runtime/printimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,13 @@ static int PrintImpl__writeBufConvertLines(const char *filename)
fclose(file);
return 1;
}
#define ABC __FILE__
fprintf(file,"#define OMC_FILE __FILE__\n#line %ld OMC_FILE\n", nlines++);
fprintf(file,"#ifdef __BASE_FILE__\n"
" #define OMC_FILE __BASE_FILE__\n"
"#else\n"
" #define OMC_FILE \"%s\"\n"
"#endif\n"
"#line %ld OMC_FILE\n",
filename, nlines++);
do {
next = strchr(str,'\n');
if (!next) {
Expand Down

0 comments on commit 516d007

Please sign in to comment.