292 Commits

Author SHA1 Message Date
Zeex
05fb325dd1 True warning fix 2015-04-07 19:09:43 +06:00
Zeex
c0cb31de01 Fix unreferenced local variable warning 2015-04-07 14:25:16 +06:00
Zeex
2df5c68af1 Fix memory leak in previous commit 2015-04-07 13:36:00 +06:00
Zeex
8b9af3a2e2 Fix incomplete '\' support in compat mode
See d0f3a9a8df (commitcomment-10583578)
2015-04-07 05:25:47 +06:00
Zeex
6b3c30aa9e Add new built-in constant __compat
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`.
2015-04-06 18:08:27 +06:00
Zeex
898e02b771 Fix MSVC compile warnings 2015-04-06 17:36:10 +06:00
Zeex
c2f59e54d9 Fix Borland build
Apparently UIN16_MAX was defined somewhere in stdint.h on other
compilers but BCC 5.5 doesn't have that.
2015-04-06 17:26:23 +06:00
Zeex
e5de4b15ef Remove unnecessary assignment 2015-04-06 17:11:35 +06:00
Zeex
aef6d6d252 Fix CMake warning (COPY_ONLY -> COPYONLY) 2015-04-06 17:07:58 +06:00
Zeex
19ced18553 Fix MinGW link warning 2015-04-06 17:00:27 +06:00
Zeex
2214988c05 Fix redefinition of S_ISDIR() on MinGW 2015-04-06 16:55:20 +06:00
Zeex
867f6902f3 Remove string compression
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).
2015-04-06 16:38:08 +06:00
Zeex
2e162eae9c Fix string array initialization
It's been broken since commit e1082f64bc4171884316621f6f62a49c45d97e81

Fixes #53 (one more time)
2015-04-06 15:26:02 +06:00
Zeex
7314b56579 Fix error on multi-dimensional array initialization
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
2015-04-06 12:35:08 +06:00
Zeex
177ab5646a Add pawndisasm.exe to artifacts 2015-04-05 22:23:09 +06:00
Zeex
a2a8039e69 Fix debug header size miscalculation pawndisasm-20150405 2015-04-05 01:39:44 +06:00
Zeex
568c277b03 Fix unused fread() return value warnings 2015-04-05 01:39:44 +06:00
Zeex
17b5c4ffe6 Add missing declaration of pc_createtmpsrc() 2015-04-05 01:39:44 +06:00
Zeex
f99e141b75 Merge branch 'osx' 2015-04-04 23:34:56 +06:00
Zeex
0a146f7344 Set project language to C
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++.
2015-04-04 23:25:41 +06:00
Zeex
b57210fe80 Detect strlcpy() and strlcat() via cmake 2015-04-04 23:21:40 +06:00
Zeex
6e8319d4f4 Don't strip symbols
Really, why do this?
2015-04-04 18:14:32 +06:00
Zeex
12afdf16c2 Refactor temporary source file creation
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.
2015-04-04 18:14:26 +06:00
Zeex
d6b77d645a Revert unrelated change 2015-04-04 17:54:02 +06:00
Zeex
f9fde04a1a Don't suppress compile warnings 2015-04-04 17:54:02 +06:00
Oscar Broman
8afb73c00c make it compile on OS X 2015-04-04 17:54:00 +06:00
Zeex
8de7022753 Fix comment 2015-04-04 16:09:40 +06:00
Zeex
2ffc78717b Fix Gitter badge placement 2015-04-04 15:03:49 +05:00
Zeex
f0af8c839a Merge pull request #51 from gitter-badger/gitter-badge
Add a Gitter chat badge to readme.md
2015-04-04 15:01:02 +05:00
The Gitter Badger
dbb48a2a9c Added Gitter badge 2015-04-04 09:58:28 +00:00
Zeex
d77e75b67f Append git commit hash to version string
Closes #25
2015-04-04 15:56:15 +06:00
Zeex
932efdfad9 Fix 2d ellips initializer not increasing on next element
Closes #48.
2015-04-04 14:36:11 +06:00
Zeex
128c56df3f Revert "Reset pc_compat before second pass"
This reverts commit 3c22187fb494592a51162c3863b3521cf1d74cc3.

That commit broke the -Z compile flag. The idea was to allow having
different compat modes for regions of code.
2015-04-03 23:55:20 +06:00
Zeex
35190f55fb Incremental ... initialization of 2d arrays
This is fully supported now:

    new arr[3][3] = {{0, 1, ...}, {0, 2, ...}, ...};

will produce:

    {{0, 1, 2}, {0, 2, 4}, {0, 3, 6}}

and this:

    new arr[3][3] = {{0, 1, ...}, ...};

will yield:

    {{0, 1, 2}, {0, 1, 2}, {0, 1, 2}}

Refs #48
2015-04-03 23:19:12 +06:00
Zeex
e1082f64bc Add partial support for ... inintialization of 2d arrays
Refs #48
2015-04-03 12:06:12 +06:00
Zeex
eeefc4ba3b Fix compile warnings 2015-04-02 15:58:00 +06:00
Zeex
c36b495c36 Modernize CMakeLists.txt 2015-04-02 15:21:08 +06:00
Zeex
3c22187fb4 Reset pc_compat before second pass 2015-04-02 12:51:02 +06:00
Zeex
b74b481c80 Don't change __Pawn in compat mode
__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
2015-04-02 12:33:10 +06:00
Zeex
998a1440a8 Add #pragma compat <value>
\#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.
2015-04-01 23:53:59 +06:00
Zeex
647c915ab1 Fix comment 2015-03-31 22:13:46 +06:00
Zeex
3bceee9570 Fix Windows build 2015-03-31 01:38:37 +06:00
Zeex
7eba1d6bc6 Fix freeze when include file is a directory
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.
2015-03-31 01:17:54 +06:00
Zeex
d0f3a9a8df Allow use of backslash in #include in compatibility mode
This allows you to use \ as a directory separator on non-Windows
platforms. It was adopted from another patch by Slice:

534cd02895
2015-03-31 00:15:24 +06:00
Zeex
a571801ba8 Fix readme again
older, not newer
2015-03-30 16:30:22 +05:00
Zeex
4ee69ee6a5 Some readme fixes 2015-03-29 10:49:14 +05:00
Zeex
36f62ff4bd Set generator to 'Visual Studio 10 2010' on AppVeyor 2015-03-29 00:06:36 +06:00
Zeex
13680704ea Fix path to artifacts in AppVeyor config 2015-03-29 00:06:36 +06:00
Zeex
8e53408cdb Add readme.md 2015-03-28 12:03:44 +05:00
Zeex
4843a44889 Merge pull request #45 from Misiur/fix/issue-44
Fix enum field size (credit to @Arkshine)
2015-03-27 16:06:21 +05:00