Mercurial > pub > dyncall > dyncall
comparison test/ellipsis/ellipsis.cc @ 606:85b7a117b807
- more statics in test code (this is partly needed on an experimental freebsd sparc64 build where the elf cleanup code crashes for some reason ... it's probably that experimental build, but a good change to do regardless)
author | Tassilo Philipp |
---|---|
date | Wed, 21 Sep 2022 15:20:58 +0200 |
parents | f5577f6bf97a |
children |
comparison
equal
deleted
inserted
replaced
605:0f40e13a2f0a | 606:85b7a117b807 |
---|---|
4 Library: test | 4 Library: test |
5 File: test/ellipsis/ellipsis.cc | 5 File: test/ellipsis/ellipsis.cc |
6 Description: | 6 Description: |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
10 Tassilo Philipp <tphilipp@potion-studios.com> | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | 11 |
12 Permission to use, copy, modify, and distribute this software for any | 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 | 13 purpose with or without fee is hereby granted, provided that the above |
14 copyright notice and this permission notice appear in all copies. | 14 copyright notice and this permission notice appear in all copies. |
34 #include <stdarg.h> | 34 #include <stdarg.h> |
35 #else | 35 #else |
36 #include <cstdarg> | 36 #include <cstdarg> |
37 #endif | 37 #endif |
38 | 38 |
39 DCValue mValue[NARGS]; | 39 static DCValue mValue[NARGS]; |
40 | 40 |
41 void clearValues() { for(int i = 0;i<NARGS;++i) mValue[i].L = 0xCAFEBABEDEADC0DEULL; } | 41 void clearValues() { for(int i = 0;i<NARGS;++i) mValue[i].L = 0xCAFEBABEDEADC0DEULL; } |
42 | 42 |
43 template<typename T> void g(T value, int pos); | 43 template<typename T> void g(T value, int pos); |
44 | 44 |
51 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; } | 51 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; } |
52 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; } | 52 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; } |
53 | 53 |
54 DCValue* getArg(int pos) { return &mValue[pos]; } | 54 DCValue* getArg(int pos) { return &mValue[pos]; } |
55 | 55 |
56 int gID; | 56 static int gID; |
57 int getId() { return gID; } | 57 int getId() { return gID; } |
58 | 58 |
59 extern "C" { | 59 extern "C" { |
60 | 60 |
61 #define VF0(id,S) void S () {gID=id;} | 61 #define VF0(id,S) void S () {gID=id;} |
96 #define VF7(id,A1,A2,A3,A4,A5,A6,A7,S) (void*)S, | 96 #define VF7(id,A1,A2,A3,A4,A5,A6,A7,S) (void*)S, |
97 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) (void*)S, | 97 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) (void*)S, |
98 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) (void*)S, | 98 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) (void*)S, |
99 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) (void*)S, | 99 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) (void*)S, |
100 | 100 |
101 DCpointer gFuncTable[] = { | 101 static DCpointer gFuncTable[] = { |
102 #include "case.h" | 102 #include "case.h" |
103 }; | 103 }; |
104 | 104 |
105 DCpointer getFunc(int x) { | 105 DCpointer getFunc(int x) { |
106 return gFuncTable[x]; | 106 return gFuncTable[x]; |
107 } | 107 } |
108 |