diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index 34fe41f..fb91b0c 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -1495,6 +1495,7 @@ static void setconstants(void) add_constant("__Pawn",VERSION_INT,sGLOBAL,0); add_constant("__line",0,sGLOBAL,0); + add_constant("__compat",pc_compat,sGLOBAL,0); debug=0; if ((sc_debug & (sCHKBOUNDS | sSYMBOLIC))==(sCHKBOUNDS | sSYMBOLIC)) diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index e739669..3bcbe8e 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1237,8 +1237,12 @@ static int command(void) } } else if (strcmp(str,"compat")==0) { cell val; + symbol *sym; preproc_expr(&val,NULL); pc_compat=(int)val; /* switch compatibility mode on/off */ + sym=findconst("__compat",NULL); + assert(sym!=NULL); + sym->addr=pc_compat; } else { error(207); /* unknown #pragma */ } /* if */