Revision history for KeyPgAliasModifier


Revision [23717]

Last edited on 2019-10-12 07:09:40 by fxm [formatting for .chm]
Additions:




Revision [23710]

Edited on 2019-10-11 03:19:42 by fxm [formatting for .chm]
Deletions:





Revision [23694]

Edited on 2019-10-09 03:57:14 by fxm [formatting for .chm]
Additions:





##[[KeyPgInteger|integer]]## on 64-bit targets is 64-bits wide. However, on Win target, ""c/c++""'s ##long int## type is 32-bit, not 64-bit, and we can't use the ##long long int## mangling because it's already used by FB's ##[[KeyPgLongint|longint]]## type. Reusing the same mangling (decoration) for two different data types would cause function overloading to fail or have duplicate definitions. To preserve FB's behaviour that ##Integer## on 64-bit targets is always 64-bits, we mangle (decorate) the symbol with a custom datatype and keep the size at 64-bit.
Deletions:
##[[KeyPgInteger|integer]]## on 64-bit targets is 64-bits wide. However, on Win target, ""c/c++""'s ##long int## type is 32-bit, not 64-bit, and we can't use the ##long long int## mangling because it's already used by FB's ##[[KeyPgLongint|longint]]## type. Reusing the same mangling (decoration) for two different data types would cause function overloading to fail or have duplicate definitions. To preserve FB's behaviour that ##Integer## on 64-bit targets is always 64-bits, we mangle (decorate) the symbol with a custom datatype and keep the size at 64-bit.


Revision [22625]

Edited on 2019-03-11 20:39:43 by JeffMarshall [add default cva_list data type declarations]
Additions:
Modifies the data type name mangling (decoration) of a public symbol
... [[KeyPgAs|as]] [ [[KeyPgConstQualifier|const]] ] //[[DataType|datatype]]// **alias "//modifier//"** [ [[KeyPgConstQualifier|const]] [ [[KeyPgPtr|ptr]] ... ] ]
[[KeyPgDim|dim]] //variable// [[KeyPgAs|as]] //[[DataType|datatype]]// **alias "//modifier//"**
[[KeyPgTypeAlias|type]] //name// [[KeyPgAs|as]] //[[DataType|datatype]]// **alias "//modifier//"**
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] //name// ( //param// [[KeyPgAs|as]] //[[DataType|datatype]]// **alias "//modifier//"**, ... )
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] //name// ( //param// [[KeyPgAs|as]] //[[DataType|datatype]]// **alias "//modifier//"**, ... ) [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"**
{{fbdoc item="param"}}
##//datatype//##
Standard data type or user defined data type to modify
##//modifier//##
One of the supported modifiers as described in Description section following
Maps ##any ptr## to ""c/c++""'s ##char *##. In ""c/c++"", ##char##, ##signed char##, and ##unsigned char##, are three distinct types.
- ##[[KeyPgByte|byte]] [[KeyPgPtr|ptr]]## maps to ##signed char *##
- ##[[KeyPgByte|ubyte]] [[KeyPgPtr|ptr]]## maps to ##unsigned char *##
- On some platforms the variable argument list ##va_list## type is a typed as a ##char *##, but FB does not have an equivalent type, therefore ##[[KeyPgAny|any]] [[KeyPgPtr|ptr]]## is used instead. Linking with names encoded with this type will fail since, normally, FB encodes ##void *## data type instead of ##char *##.
- ##alias "char"## keeps the ##any ptr## behaviour in FB but then encodes the public name as ##char *## for linking.
Maps the data type to gcc's ""__builtin_va_list"" type
- expected that gcc's built-in type is a pointer type
- used on dos, win32, win64, linux-x86, targets
- see ##[[KeyPgCvaList|cvalist]]## for default usage in the ##cva_list## data type
##alias """__builtin_va_list"""##
Maps the data type to gcc's ""__builtin_va_list"" type
- expected that gcc's built-in type is a ##struct## type
- used on aarch64 target
- see ##[[KeyPgCvaList|cvalist]]## for default usage in the ##cva_list## data type
##alias """__builtin_va_list[]"""##
Maps the data type to gcc's ""__builtin_va_list"" type
- expected that gcc's built-in type is a ##struct## array type
- used on linux-x86_64 target
- see ##[[KeyPgCvaList|cvalist]]## for default usage in the ##cva_list## data type
- 64-bit ##[[KeyPgUinteger|uinteger]]## maps to ##unsigned long [int]##
Deletions:
Modifies the name mangling of a variable or procedure parameter
//datatype_declaration// [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"
[[KeyPgDim|dim]] //variable// [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"**
[[KeyPgTypeAlias|type]] //name// [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"**
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] //name// ( //param// [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"**, ... )
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] //name// ( //param// [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"**, ... ) [[KeyPgAs|as]] [[DataType|datatype]] **alias "//modifier//"
Maps ##any ptr## to ""c/c++""'s ##char *##
!!!! WRITEME !!!!
!!!! WRITEME !!!!
##"""__va_list""" alias """__builtin_va_list[]"""##
!!!! WRITEME !!!!
##"""__va_list""" alias """__builtin_va_list"""##
!!!! WRITEME !!!!
- 64-bit ##[[KeyPgUinteger|uinteger]]## maps to ##long [int]##
{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/procs/alias.bas"}}%%(freebasic)
%%


Revision [22618]

The oldest known version of this page was created on 2019-03-11 05:21:03 by JeffMarshall [add default cva_list data type declarations]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode