The __compat constant is set to 0 when compatibility mode is disabled
and 1 (or some non-zero value) if enabled, either by using -Z or with
`#pragma compat`.
This removes all scpack-packed strings and moves normal strings from
.scp files to corresponding .c files. The code responding for packing
and unpacking is gone as well.
If you have enough memory to run a SA-MP server you most likely have
more than enough of it to not worry about saving a few additional KBs
of text. Besides, these strings were kind of hard to navigate / edit,
and you could easily forget to regenerate them with scpack (though it
could be automated).
The 2d ellipsis patch broke normal array initialization:
// error 052: multi-dimensional arrays must be fully initialized
new foo[3][2][] = {
{"Bar","Bar"},
{"Boo","Boo"},
{"Bee","Bee"}
};
// This one caused an assert error:
new foo[3][2][4] = {
{"Bar","Bar"},
{"Boo","Boo"},
{"Bee","Bee"}
};
Fixes#53
check_function_exists() tried to use a C++ compiler for some odd reason,
so I've set the language to C explicitly. This shouldn't hurt in theory,
since we don't use C++.
This adds a new function pc_createtmpsrc() that creates a temporary
source file for writing. Also, mkstemp() is now used not only on Mac
OS X but on Linux (and other Unixes) as well.
This reverts commit 3c22187fb494592a51162c3863b3521cf1d74cc3.
That commit broke the -Z compile flag. The idea was to allow having
different compat modes for regions of code.
__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
\#pragma compat allows you to toggle compatibility mode on or off,
depending on the argument (0 or 1).
Note: #pragma compat doesn't affect the value of built-in constants,
e.g. __Pawn.
This adds an extra check in plungequalifiedfile() that ensures that
the file being includes is not a directory. It seems to be the only
place where we need to check that, in other places files are opened
by exact name.
The bug appears to be specific to the Linux compiler. On Windows
fopen() will return NULL if trying to open a directory.
Fixes#41.