Backported the changes CompuPhase did to the compiler to support string
literal concatenation including all fixes in later commits from r30 on.
http://code.google.com/p/pawnscript/source/detail?r=30
Pawn uses ellipses "..." to concatenate so it looks like this:
#define PROJECT_AUTHOR "Greyscale"
#define PROJECT_COPYRIGHT "Copyright (C) 2010 " ... PROJECT_AUTHOR
This would result in PROJECT_COPYRIGHT being defined as
"Copyright (C) 2010 Greyscale"
While i've been at it, that stringizing a macro parameter feature was
ported too.
From the changelog for version 3.3.4026
(http://www.compuphase.com/pawn/pawnhistory.htm):
The macro substition processor now recognizes the "#" character for
"stringizing" a parameter. For example, if you have the definition
#define log(%1) #%1
Then the expression log(test) will result in "test".
Note that concatenation of literal strings requires an ellipsis in pawn
(which is different than C/C++). So to combine the parameter with
literal strings, use a syntax like:
#define log(%1) "logging: " ... #%1 ... "\n"
The stringize operator is only available in the replacement text of a
macro.
Doing
PrintToServer(log(hello));
would print
logging: hello\n
Original patch written by David Anderson (original r from Fyren).
- Updated to function with the current JIT compiler.
- Took in clean-ups from later-dated patches.
Summary:
10.9's SDK changed strlcat and strlcmp to macros, which has broken lots of code. As they will always be available from the system (being BSD functions), just use the system ones there.
tempnam has also been deprecated, refactoring spcomp to use it safely is quite a bit of work, and it's not critical, so just hacking around it with mkstemp.
Test Plan: Compiled spcomp.
Reviewers: dvander
Differential Revision: https://phabricator.alliedmods.net/D3
--HG--
extra : rebase_source : 535b88f815727b186fa6a141036599651a60e334
Summary: When there are more than 32768 SLOC in a file, spcomp underflows when storing debug info. These are safe to change as the file-backed struct uses uint32_t already.
Test Plan: Compiled the test plugin from bug 5959. I didn't load it, but it compiled without error and the SMX file is valid.
Reviewers: BAILOPAN
Differential Revision: https://phabricator.alliedmods.net/D2
--HG--
extra : rebase_source : fa907333b8c0dcab6e78c69ad4a92cdfb048083f
extra : amend_source : c7d2ec7d8b880459a57e4b2df5c1e8bbab5585bb
- Introduce HashMap, a key-value map based on HashTable.
- Introduce LinkedList, to port from SourceHook::List.
- Introduce AString, to port from SourceHook::String.
- Introduce KE_OVERRIDE and KE_DELETE helpers for C++11.
- HashTable now constructs/destructs only live items.
- Fix insert-on-removed-item bug in HashTable.
- Fix Vector keeping a new maxsize if allocation fails.
- Renamed am-inline-list.h to am-inlinelist.h.
--HG--
rename : public/amtl/am-inline-list.h => public/amtl/am-inlinelist.h
The tracker related opcodes:
GENARRAY
GENARRAY_Z
TRACKER_POP_SETHEAP
TRACKER_PUSH_C
All contain some vastly overcomplicated assembly containing logic that could
be implemented much easier in C++. If it were a performance concern, these
opcodes would be entirely in C++, but most of them call out to one or more
routines to do additional work. This patch just moves most of the logic out
to C++ to reduce complexity and fix reported bugs.
--HG--
extra : rebase_source : 1397056ac3ca3efb969e66ec577e2b33ca725e1a