Fix faulty assert

It is allowed for symbol names to be up to sNAMEMAX characters but
the assert() restricted them to sNAMEMAX-1 characters, so it would
fail for any long enough name.

Ran across this investigating #21.
Revert "Don't generate automatic include guards"

This reverts commit 05e34102d4949a7992f836db13085a85dea7c82c.

Conflicts:
	source/compiler/sc2.c
Introduce compatibility mode

The compiler now has a new command-line option (-Z) that toggles
between normal mode and "compatibility" mode.

When this mode is on the compiler attempts to be compatible with
the current SA-MP compiler, which allows compiling old SA-MP scripts
that would not compile otherwise and at the same time benefiting
from new features and bug fixes.

In particular, this allows compiling code that relies on the auto
generated #include guard symbols (_inc_filename).

And in case you're wondering, the Z in "-Z" does not stand for "Zeex",
it just means "a letter that is unlikely to be ever taken by another
option".

This closes #23.
Fix crash with long function names

This fixes a buffer overrun introduced by commit eba8474294c1c106dd6e4f62a73160798f16458d.

The crash happens in do_call() when a function name was longer than
the max. allowed (sNAMEMAX) because of the leading '.' (dot) inserted
in command().

--------- test code --------

#include <a_samp>

OverlyLongFunctionNameYouCantEvenBotherToRead() {
	print("hey");
}

main() {
	OverlyLongFunctionNameYouCantEvenBotherToRead();
}

----- end of test code -----
Add some missing bits from upstream trailing comma patch

https://code.google.com/p/pawnscript/source/detail?r=33

There's still a problem with trailing commas in array initialization:

http://forum.sa-mp.com/showpost.php?p=2975468&postcount=55
Fix trailing comma breaking array init vectors

This patch fixes a bug in commit d23e03e "Allow trailing comma in array
initializers" where initarray() did an extra loop iteration hoping that
initvector() would fail nicely and ultimately inserted an extra cell
into the literal queue.

--------- test code --------

native printf(const format[], ...);

new const a[][] = {
	{"hello"},
	{"world"}
};

main() {
	printf("%s", a[0]);          // hello
	printf("%d", sizeof(a));     // 2
	printf("%d", sizeof(a[]));   // 6
	printf("%d", sizeof(a[][])); // 1
}

----- end of test code -----
Fix crash when compiling with -r

This fixes a crash in sc_attachdocumentation() where get_docstring()
returned an invalid string pointer because get_string() compared the
string index with list->size instead of list->length (the actual length
of the list).

Fixes #19.
Fix assert failure due to signed/unsigned char mismatch
Revert "Fix assert failure due to signed/unsigned char mismatch"

This reverts commit a1d0fe39d488f2376b76b6b2d0a81f29b1b61dcc.

It's a total mess! I can't understand their logic on choosing signed vs.
unsigned char. I guess I'd better off not touching this at all.
Add /J to MSVC compile flags

http://msdn.microsoft.com/en-us/library/0d294k5z.aspx

/J (Default char Type Is unsigned)

Changes the default char type from signed char to unsigned char, and
the char type is zero-extended when it is widened to an int type.
Add missing comma
Ignore #pragma tabsize with non-positive arguments

#pragma tabsize X will now have no effect for X <= 0. Same goes for
the -t option (will display usage instead).

Closes #24.
Fix crash on error 33 in ternary operator

If one of the two values is a string literal and the other is a
non-array, the symbol associated with the first one will be NULL.
But the code checked if sym->name!=NULL rather than sym!=NULL,
hence the crash.

--------- test code --------

main() {
    new a, b;
    return (a != 0 ? b : "string");
}

----- end of test code -----
Fix another error 33 crash

This fixes the same coding mistake as in the previous commit (4d2c600):
"sym->name!=NULL" should be "sym!=NULL" as sym->name can't be NULL.

--------- test code --------

main() {
	if ("string") {}
}

----- end of test code -----
Fuck trailing comma
Fix value of cellmin/cellmax in x64 Linux build

When built with PAWN_CELL_SIZE==32 cellmin anx cellmax were set
to LONG_MIN anx LONG_MAX respectively, but long is 64 bits wide
on 64-bit Linux systems (as opposed to Win64).

Fixes #17.
Fix find_symbol() returning wrong symbol

Stop find_symbol() from exiting too early when have multiple matching
symbols (static and non-static). Ignore non-static symbols (those with
fnumber == -1) unless found nothing else.

Fixes #20.
Merge tag 'binaries-20140427' into lse