Mercurial > pub > dyncall > dyncall
annotate test/malloc_wx/test_wx.c @ 663:127b569978cc default tip
- another tweak handling clang trying to be too smart (see last commit)
author | Tassilo Philipp |
---|---|
date | Sun, 24 Mar 2024 13:52:44 +0100 |
parents | f76dbea7a0c1 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: test | |
5 File: test/malloc_wx/test_wx.c | |
6 Description: | |
7 License: | |
8 | |
281 | 9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | |
12 Permission to use, copy, modify, and distribute this software for any | |
13 purpose with or without fee is hereby granted, provided that the above | |
14 copyright notice and this permission notice appear in all copies. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
23 | |
24 */ | |
25 | |
26 | |
27 | |
28 #include "../../dyncallback/dyncall_alloc_wx.h" | |
29 #include "../common/platformInit.h" | |
30 #include "../common/platformInit.c" /* Impl. for functions only used in this translation unit */ | |
31 | |
32 | |
33 int main() | |
34 { | |
35 int err; | |
36 void* ptr; | |
37 dcTest_initPlatform(); | |
38 | |
39 err = dcAllocWX(23, &ptr); | |
251
3f7c69fadfc3
- regression fix for changing writable to executable memory for platforms where
Tassilo Philipp
parents:
203
diff
changeset
|
40 if(!err) { |
3f7c69fadfc3
- regression fix for changing writable to executable memory for platforms where
Tassilo Philipp
parents:
203
diff
changeset
|
41 err = dcInitExecWX(ptr, 23); |
3f7c69fadfc3
- regression fix for changing writable to executable memory for platforms where
Tassilo Philipp
parents:
203
diff
changeset
|
42 dcFreeWX(ptr, 23); |
3f7c69fadfc3
- regression fix for changing writable to executable memory for platforms where
Tassilo Philipp
parents:
203
diff
changeset
|
43 } |
584 | 44 printf("result: malloc_wx: %d\n", (!err) ? 1 : 0 ); |
0 | 45 |
46 dcTest_deInitPlatform(); | |
47 | |
48 return err; | |
49 } | |
50 |