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 {
|
124
|
51 #if (defined(DC__Arch_PPC32) || defined(DC__Arch_MIPS)) && defined(DC__Endian_BIG)
|
0
|
52 DCbool B;
|
|
53 struct { DCchar c_pad[3]; DCchar c; };
|
|
54 struct { DCuchar C_pad[3]; DCuchar C; };
|
|
55 struct { DCshort s_pad; DCshort s; };
|
|
56 struct { DCshort S_pad; DCshort S; };
|
7
|
57 DCint i;
|
|
58 DCuint I;
|
124
|
59 #elif (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64)) && defined(DC__Endian_BIG)
|
7
|
60 struct { DCbool B_pad; DCbool B; };
|
|
61 struct { DCchar c_pad[7]; DCchar c; };
|
|
62 struct { DCuchar C_pad[7]; DCuchar C; };
|
|
63 struct { DCshort s_pad[3]; DCshort s; };
|
|
64 struct { DCshort S_pad[3]; DCshort S; };
|
|
65 struct { DCint i_pad; DCint i; };
|
|
66 struct { DCint I_pad; DCuint I; };
|
0
|
67 #else
|
7
|
68 DCbool B;
|
0
|
69 DCchar c;
|
|
70 DCuchar C;
|
|
71 DCshort s;
|
|
72 DCushort S;
|
|
73 DCint i;
|
|
74 DCuint I;
|
7
|
75 #endif
|
0
|
76 DClong j;
|
|
77 DCulong J;
|
|
78 DClonglong l;
|
|
79 DCulonglong L;
|
|
80 DCfloat f;
|
|
81 DCdouble d;
|
|
82 DCpointer p;
|
|
83 DCstring Z;
|
|
84 };
|
|
85
|
|
86 #ifdef __cplusplus
|
|
87 }
|
|
88 #endif
|
|
89
|
|
90 #endif /* DYNCALL_VALUE_H */
|
|
91
|