Hi,
this patch contains the extension of the suspend
feature and serveral source clean-ups. It must be
applied to 2.0b1!
Before you can apply the patch, you must rename
"sqstdrex.c" to "sqstdrex.cpp".
To apply this patch, please enter the SQUIRREL root
source directory (e.g. C:\Squirrel2) and execute the
following command:
patch -u -b -p 1 < path_to_patch_file/sqdiff.patch
The following changes were done:
include/squirrel.h
- Using "bool" for SQBool when using a C++ compiler
- Using "true" and "false" for "SQTrue" and "SQFalse"
- Added prototypes for additional functions
sqstdlib/Makefile
- Changing sqstdrex.c to sqstdrex.cpp
sqstdlib/sqstdaux.cpp
- Warning fixes
sqstdlib/sqstdblob.cpp
- Warning fixes
sqstdlib/sqstdio.cpp
- Warning fixes
sqstdlib/sqstdlib.cpp
- Warning fixes
sqstdlib/sqstdrex.cpp
- Warning fixes
sqstdlib/sqstdstream.cpp
- Warning fixes
squirrel/sqapi.cpp
- Warning fixes
- Added support to query the stack without respecting
the stack base
- Added support for suspend through multiple native
functions
- Added support for a vm suspend after execution of n
opcodes
squirrel/sqarray.h
- Warning fixes
squirrel/sqbaselib.cpp
- Warning fixes
squirrel/sqclosure.h
- Reformatting
squirrel/sqcompiler.cpp
- Warning fixes
- Fixing build errors with Borland C++ Builder 4
squirrel/sqdebug.cpp
- Warning fixes
squirrel/sqfuncstate.cpp
- Warning fixes
squirrel/sqlexer.cpp
- Warning fixes
squirrel/sqobject.cpp
- Warning fixes
squirrel/sqopcodes.h
- Warning fixes
- Fixing build error for compilers that treat
"0xFFFFFFFF" as -1 by changing the constant to 0x7FFFFFFF
squirrel/sqtable.h
- Warning fixes
squirrel/sqvm.cpp
- Warning fixes
- Added support to query the stack without respecting
the stack base
- Added support for suspend through multiple native
functions
squirrel/sqvm.h
- Some extensions to hold the additional data required
for additional features
But be warned that the new features are just tested
roughly.
I'll also attach a test application that might help you
to understand my changes.
The support for vm suspend through multiple native
functions is achieved by using "check points". The
default check point value for a called native function
is 0. The native function then can change the check
point value to be able to execute the correct code when
it's been re-called for a wake up.
For every native function, the nr. of max. execution
steps till automatic vm suspend is set to 0 by default
(turned off) to remain compatible with older code.
Regards,
Mark Junker
Patch file for VM extensions/fixes
Test application
Logged In: YES
user_id=995396
To be able to use the test application, you must use a
compiler that supports the usage of <tchar.h> and _tmain.