Mercurial > pub > dyncall > dyncall
annotate dyncall/dyncall_value.h @ 211:60ec815531b9
- more doc overview corrections
author | Tassilo Philipp |
---|---|
date | Tue, 28 Mar 2017 15:36:45 +0200 |
parents | b11b0735b09f |
children | f5577f6bf97a |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncall | |
5 File: dyncall/dyncall_value.h | |
6 Description: Value variant type | |
7 License: | |
8 | |
9 Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, | |
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 | |
29 dyncall value variant | |
30 | |
31 a value variant union-type that carries all supported dyncall types. | |
32 | |
33 REVISION | |
34 2007/12/11 initial | |
35 | |
36 */ | |
37 | |
38 #ifndef DYNCALL_VALUE_H | |
39 #define DYNCALL_VALUE_H | |
40 | |
41 #include "dyncall_types.h" | |
42 | |
43 #ifdef __cplusplus | |
44 extern "C" { | |
45 #endif | |
46 | |
47 typedef union DCValue_ DCValue; | |
48 | |
49 union DCValue_ | |
50 { | |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
51 /* dyncallback assembly pulls value directly from DCValue structs, without */ |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
52 /* knowledge about types used, so lay it out as needed at compile time, here */ |
157
49549739228c
- sparc callback asm and args code (still some stack alignment issues, currently)
cslag
parents:
134
diff
changeset
|
53 #if defined(DC__Endian_BIG) && (defined(DC__Arch_PPC32) || defined(DC__Arch_MIPS) || defined(DC__Arch_Sparc)) |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
54 DCbool B; |
0 | 55 struct { DCchar c_pad[3]; DCchar c; }; |
56 struct { DCuchar C_pad[3]; DCuchar C; }; | |
57 struct { DCshort s_pad; DCshort s; }; | |
58 struct { DCshort S_pad; DCshort S; }; | |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
59 DCint i; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
60 DCuint I; |
179 | 61 #elif defined(DC__Endian_BIG) && (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64) || defined(DC__Arch_Sparc64)) |
7 | 62 struct { DCbool B_pad; DCbool B; }; |
63 struct { DCchar c_pad[7]; DCchar c; }; | |
64 struct { DCuchar C_pad[7]; DCuchar C; }; | |
65 struct { DCshort s_pad[3]; DCshort s; }; | |
66 struct { DCshort S_pad[3]; DCshort S; }; | |
67 struct { DCint i_pad; DCint i; }; | |
68 struct { DCint I_pad; DCuint I; }; | |
0 | 69 #else |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
70 DCbool B; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
71 DCchar c; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
72 DCuchar C; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
73 DCshort s; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
74 DCushort S; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
75 DCint i; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
76 DCuint I; |
7 | 77 #endif |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
78 DClong j; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
79 DCulong J; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
80 DClonglong l; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
81 DCulonglong L; |
134 | 82 /* floats on mips are right justified in fp-registers on big endian targets, as they aren't promoted */ |
83 #if defined(DC__Endian_BIG) && (defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)) | |
126
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
84 struct { DCfloat f_pad; DCfloat f; }; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
85 #else |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
86 DCfloat f; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
87 #endif |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
88 DCdouble d; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
89 DCpointer p; |
be08b699dca5
- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents:
124
diff
changeset
|
90 DCstring Z; |
0 | 91 }; |
92 | |
93 #ifdef __cplusplus | |
94 } | |
95 #endif | |
96 | |
97 #endif /* DYNCALL_VALUE_H */ | |
98 |