Commit Graph

68 Commits

Author SHA1 Message Date
Vincent Herbet
582df637ce
Compiler: Add __FILE__, remove __BINARY_PATH__ and rename __BINARY_NAME__ to __BINARY__ (#546)
* Compiler: Add __FILE__ and remove __BINARY_PATH__ constants

* Compiler: Rename __BINARY_NAME__ to __BINARY__
2018-09-03 21:28:28 +02:00
Vincent Herbet
1a56577f7a Fix inc/dec operators not returning an iEXPRESSION (#429)
* Fix inc/dec operators not returning an iEXPRESSION

* Fix inc/dec operators in return statement
2017-04-29 23:33:09 +02:00
Vincent Herbet
faa9f6ea9f Fix returning strings from variadic functions (lost changes) (#399) 2017-01-09 20:40:28 +01:00
Nicholas Hastings
79a6dc9501 Fix shift-negative-value warning on newer compiler versions.
error: shifting a negative signed value is undefined
2016-03-17 15:12:26 -04:00
Arkshine
2c73268668 Fix issue where native functions returning an array would not compile 2016-02-22 23:37:09 +01:00
Flavio Medeiros
f796df783c Avoiding directives that split up parts of statements. 2015-12-24 12:42:34 -03:00
Arkshine
41dfdc7f59 Compiler: Prevent declaring arrays that the compiler is too buggy to handle
AM Bug 7977: https://bugs.alliedmods.net/show_bug.cgi?id=4977
2015-05-19 00:01:29 +02:00
Arkshine
f710188c86 Compiler: Ability to directly reference another address in a default argument (for arrays only)
SM patch: d8d13f1920
2015-05-19 00:01:29 +02:00
Arkshine
52c73126e1 VFS: Fix various things
- The "ALL" fake pathID is replaced by what does SM, having a public var NULL_STRING which will acts as NULL when needed.
  To make compiler accepting public array, this patch was needed: https://hg.alliedmods.net/sourcemod-central/rev/b12f329def09
- The offset thing in read_dir: considering that's something very specific to this native and that implementation in CDirectory doesn't make sense because of the offset compatibility for windows, all code is now in the native.
2015-03-25 13:50:07 +01:00
Arkshine
97369c5d6c Upgrade VS projetcs to use v120_xp toolset and fix missing include paths 2015-01-14 10:25:46 +01:00
Arkshine
a0cfa59e56 Compiler: Fix tautological warning with clang-3.5 2015-01-11 23:09:53 +01:00
Arkshine
5e622aa69f Remove static on 'disable' variable 2014-12-08 23:55:30 +01:00
Arkshine
a50f104fd3 Fix trailing commas in array literals changing the result of sizeof() 2014-12-08 20:45:33 +01:00
Arkshine
1a97b2cbe1 Improve more sizeof return on array without specifiying the dimension 2014-11-11 12:34:16 +01:00
Arkshine
3b3e78d65b Compiler: Remove commented code in previous commit 2014-09-29 20:36:14 +02:00
Arkshine
e7c7313f77 Compiler: Add a flag for warnings-as-errors 2014-09-29 15:54:39 +02:00
Arkshine
ae2699ca98 Compiler: Disable estimated memory usage 2014-09-29 15:12:56 +02:00
Arkshine
de85f2735e Fix compiler crash due to missing recursion message warning. 2014-08-31 14:52:24 +02:00
Arkshine
e46785a434 Compiler: Improve/fix recursion detection.
Imported from Pawn 3.2.3664 and 3.3.3875.
2014-08-26 09:05:23 +02:00
Arkshine
f60b00ee71 Compiler: Use hash table for global name lookups.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=4496.
2014-08-26 09:05:20 +02:00
Arkshine
a876962405 Compiler: Use in-memory buffers for reading files, and handle newlines better.
Imported from https://github.com/alliedmodders/sourcemod/pull/63.
2014-08-26 09:05:18 +02:00
Arkshine
c2ca5d857d Compiler: Change __line to __LINE__. 2014-08-26 09:05:17 +02:00
Arkshine
27825963f6 Compiler: Fix indentation. 2014-08-26 09:05:15 +02:00
Arkshine
32b546df69 Compiler: Revert "Fix runtime error in variadic functions that return strings."
Better fix by dvander will be provided later.
2014-08-26 09:05:11 +02:00
Arkshine
cea2f598b2 Compiler: Fix a regression in handling multi-dimensional arrays (introduced in 744d67b)
Fix imported from Pawn 3.3.4058.
2014-08-26 09:05:10 +02:00
Arkshine
d44eb7bf8d Compiler: Update VERSION_INT.
Some people may want to check compiler version with __Pawn, and it would be a good idea to bump the version.
Since we have a special version, and to avoid to use digit which may be used by official version, I propose using letters, so: 0x30A.
This should be resonneable.
2014-08-26 09:05:08 +02:00
Arkshine
16e5f54507 Compiler: Improve the reported line number accuracy on warning 203/4 (symbol never used).
Imported from Pawn 3.1.3541+.
https://code.google.com/p/pawnscript/source/detail?r=25
2014-08-26 09:05:03 +02:00
Arkshine
c4b233d094 Compiler: Improve sizeof return on array without specifiying the dimensions.
Imported from Pawn 3.1.3636.

"When making an array without specifiying the dimensions, but where the element
count at the lowest dimension is the same for all, the compiler now "counts"
this size, rather than setting the lowest dimension as "variable length".

An example for this situation is the declaration:
    new my_array[][] = { {1,0}, {2,1}, {3,1} }
No dimensions are given, but the new compiler determines that the minor
dimension is 2 (and the major dimension is 3). Previous compilers set the
minor dimension to 0 --meaning "variable"."
2014-08-26 09:05:00 +02:00
Arkshine
17114347d1 Compiler: Fix runtime error in variadic functions that return strings.
Imported from SM-AM: 1d1244c2f0.

"This fixes a bug where returning a string from a variadic function caused
an invalid memory access error during runtime. It seems like they forgot
to update existing string return code for variadic functions."
2014-08-26 09:04:56 +02:00
Arkshine
1866afd80b Compiler: Add __line
Imported from SA-MP: 605ae7f4d3
This is a backport from Pawn 4.0. It sets to the current line number during compile time.
Documention for 3.x actually mention this.
2014-08-26 09:04:55 +02:00
Arkshine
b2442a2268 Compiler: Ignore #pragma tabsize with non-positive argument.
Imported from SA-MP: 7f30a03f94.
2014-08-26 09:04:50 +02:00
Arkshine
1b3b07d4d8 Compiler: Add __BINARY_PATH__ and __BINARY_FILE__.
Imported from SM: https://hg.alliedmods.net/sourcemod-central/rev/bd38ac67afe1 and https://hg.alliedmods.net/sourcemod-central/rev/eb4c45360aaf.
2014-08-26 09:04:48 +02:00
Arkshine
95f3b0d354 Compiler: Fix return omission with else-after-return.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=4852.
2014-08-26 09:04:47 +02:00
Arkshine
9b5c6bfff0 Compiler: Fix asserting when returning a string literal.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=3836.
2014-08-26 09:04:45 +02:00
Arkshine
57b172072a Compiler: Fix bogus assert about name lengths.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=4486.
2014-08-26 09:04:44 +02:00
Arkshine
4f525b9150 Compiler: Fix memory corruption when parsing natives.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=5840
2014-08-26 09:04:40 +02:00
Arkshine
325a746d90 Compiler: Fix issue with multidimensional array variable release.
Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=6100.
2014-08-26 09:04:39 +02:00
Arkshine
6978e2dc4c Compiler: Fix in recursion detection.
Original fix imported from pawn 3.1.3522.
This fixes where for some plugins you would have:

   Stack/heap size:      16384 bytes; usage is unknown, due to recursion

Now, you get:

   Stack/heap size:      16384 bytes; estimated max. usage=782 cells (3128 bytes)
2014-08-26 09:04:37 +02:00
Arkshine
520493fab1 Compiler: Add #pragma deprecated.
This is based on SM, including patch to support macros/constants (https://hg.alliedmods.net/sourcemod-central/rev/ef8dd1cddc35).
Updated also some pawn includes to use this new pragma.
2014-08-26 09:04:36 +02:00
Vincent Herbet
ccf919c58c Fix typo in previous commit (r=dvander) 2014-08-21 20:57:08 +02:00
David Anderson
567fbcd517 Fix build. 2014-08-19 21:38:44 -07:00
David Anderson
6bbc4c8dbd Fix returning strings from variadic functions. 2014-08-17 10:00:51 -07:00
Asher Baker
3a43a41141 Added back estimated stack usage. 2014-08-15 23:46:16 +01:00
Asher Baker
46123d359f Add support for Emscripten to the compiler. 2014-08-15 16:32:00 +00:00
Scott Ehlert
1cff91ced5 Update license headers for compiler. 2014-08-04 13:18:28 -05:00
David Anderson
bd586d37e6 Add OS X support to AMBuild and 10.9 support to amxxpc.
Former-commit-id: 91779cb9414e0ade9c170752cfc313c0425c8d14
2014-02-08 15:25:57 -08:00
David Anderson
ad36859607 Port plugin building to AMBuild.
Former-commit-id: 9ac73de5b247da341b0b4cdf00ec3c7e0472be82
2014-02-08 12:42:00 -08:00
Scott Ehlert
40c1fee55a Added support for Mac OS X and building with clang (bug 5601, r=dvander). 2013-02-13 01:14:37 -06:00
David Anderson
b706108ed6 Squashed commit of the following:
commit 011d9b6b07d904ad1e81ef7c747269903e2d47c4
Author: David Anderson <dvander@alliedmods.net>
Date:   Mon Jan 11 00:17:08 2010 -0600

    Initial import from Subversion (amxmodx/trunk rev 3757).
2014-02-06 23:06:54 -08:00
Steve Dudenhoeffer
ea912f794c Stole the magical any: tag from sourcemod 2007-04-24 13:36:36 +00:00