comparison dyncall/dyncall_signature.h @ 533:71c884e610f0

- integration of patches from Raphael Luba, Thekla, Inc.: * integration of aggregate-by-value (struct, union) support patch for x64 (win and sysv) * windows/x64 asm additions to specify how stack unwinds (help for debuggers, exception handling, etc.) * see Changelog for details - new calling convention modes for thiscalls (platform agnostic, was specific before) * new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL) - dcCallF(), dcVCallF(), dcArgF() and dcVArgF(): * added support for aggregates-by-value (wasn't part of patch) * change that those functions don't implicitly call dcReset() anymore, which was unflexible (breaking change) - added macros to feature test implementation for aggregate-by-value and syscall support - changed libdyncall_s.lib and libdyncallback_s.lib order in callback test makefiles, as some toolchains are picky about order - doc: * man page updates to describe aggregate interface * manual overview changes to highlight platforms with aggregate-by-value support - test/plain: replaced tests w/ old/stale sctruct interface with new aggregate one
author Tassilo Philipp
date Thu, 21 Apr 2022 13:35:47 +0200
parents ddfb9577a00e
children
comparison
equal deleted inserted replaced
532:d4bf63ab9164 533:71c884e610f0
4 Library: dyncall 4 Library: dyncall
5 File: dyncall/dyncall_signature.h 5 File: dyncall/dyncall_signature.h
6 Description: Type and calling-convention signature character defines 6 Description: Type and calling-convention signature character defines
7 License: 7 License:
8 8
9 Copyright (c) 2007-2020 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.
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 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 21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 23
24 */
25
26
27
28 /*
29
30 dyncall signature characters
31
32 REVISION
33 2007/12/11 initial
34
35 */ 24 */
36 25
37 26
38 #ifndef DYNCALL_SIGNATURE_H 27 #ifndef DYNCALL_SIGNATURE_H
39 #define DYNCALL_SIGNATURE_H 28 #define DYNCALL_SIGNATURE_H
52 #define DC_SIGCHAR_ULONG 'J' 41 #define DC_SIGCHAR_ULONG 'J'
53 #define DC_SIGCHAR_LONGLONG 'l' 42 #define DC_SIGCHAR_LONGLONG 'l'
54 #define DC_SIGCHAR_ULONGLONG 'L' 43 #define DC_SIGCHAR_ULONGLONG 'L'
55 #define DC_SIGCHAR_FLOAT 'f' 44 #define DC_SIGCHAR_FLOAT 'f'
56 #define DC_SIGCHAR_DOUBLE 'd' 45 #define DC_SIGCHAR_DOUBLE 'd'
57 #define DC_SIGCHAR_POINTER 'p' 46 #define DC_SIGCHAR_POINTER 'p' /* also used for arrays, as such args decay to ptrs */
58 #define DC_SIGCHAR_STRING 'Z' /* in theory same as 'p', but convenient to disambiguate */ 47 #define DC_SIGCHAR_STRING 'Z' /* in theory same as 'p', but convenient to disambiguate */
59 #define DC_SIGCHAR_STRUCT 'T' 48 #define DC_SIGCHAR_AGGREGATE 'A' /* aggregate (struct/union described out-of-band via DCaggr) */
60 #define DC_SIGCHAR_ENDARG ')' /* also works for end struct */ 49 #define DC_SIGCHAR_ENDARG ')'
61 50
62 /* calling convention / mode signatures */ 51 /* calling convention / mode signatures */
63 52
64 #define DC_SIGCHAR_CC_PREFIX '_' 53 #define DC_SIGCHAR_CC_PREFIX '_' /* announces next char to be one of the below calling convention mode chars */
65 #define DC_SIGCHAR_CC_DEFAULT ':' /* default calling conv (platform native) */ 54 #define DC_SIGCHAR_CC_DEFAULT ':' /* default calling conv (platform native) */
66 #define DC_SIGCHAR_CC_THISCALL '*' /* C++ this calls (platform native) */ 55 #define DC_SIGCHAR_CC_THISCALL '*' /* C++ this calls (platform native) */
67 #define DC_SIGCHAR_CC_ELLIPSIS 'e' 56 #define DC_SIGCHAR_CC_ELLIPSIS 'e'
68 #define DC_SIGCHAR_CC_ELLIPSIS_VARARGS '.' 57 #define DC_SIGCHAR_CC_ELLIPSIS_VARARGS '.'
69 #define DC_SIGCHAR_CC_CDECL 'c' /* x86 specific */ 58 #define DC_SIGCHAR_CC_CDECL 'c' /* x86 specific */