Don't change __Pawn in compat mode

__Pawn is now fixed at 0x030A, i.e. the new value that was used in
non-compat mode.

I've  come to realize that setting it to the old value doesn't really
make much sense - we still allow the use of the new features but at
the same time pretend to be the old compiler which of course doesn't
have those features.

Maybe we should add another built-in constant for that, perhaps call
it __compat or something similar and define it only when running in
compat mode. The users could then check if the compiler is in compat
mode like this:

  #if defined __compat
      ...
  #endif
This commit is contained in:
Zeex 2015-04-02 12:24:47 +06:00
parent 998a1440a8
commit b74b481c80

View File

@ -65,8 +65,7 @@
#include "sc.h"
#include "svnrev.h"
#define VERSION_STR "3.2." SVN_REVSTR
#define VERSION_INT 0x030A
#define VERSION_INT_COMPAT 0x0302
#define VERSION_INT 0x030A
static void resetglobals(void);
static void initglobals(void);
@ -1462,7 +1461,7 @@ static void setconstants(void)
add_constant("charmax",~(-1 << sCHARBITS) - 1,sGLOBAL,0);
add_constant("ucharmax",(1 << (sizeof(cell)-1)*8)-1,sGLOBAL,0);
add_constant("__Pawn",pc_compat ? VERSION_INT_COMPAT : VERSION_INT,sGLOBAL,0);
add_constant("__Pawn",VERSION_INT,sGLOBAL,0);
add_constant("__line",0,sGLOBAL,0);
debug=0;
@ -5992,4 +5991,3 @@ static int *readwhile(void)
return (wqptr-wqSIZE);
} /* if */
}