Skip to content

Commit 5ffd463

Browse files
committed
fbdocs: wiki snapshow 2021.06.28 - new pages
1 parent 3f3cde5 commit 5ffd463

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

doc/manual/cache/CatPgFullIndex.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ Alphabetical listing of keywords, macros and procedures.
558558
- {{fbdoc item="keyword" value="KeyPgTan|TAN"}}
559559
- {{fbdoc item="keyword" value="KeyPgThen|THEN"}}
560560
- {{fbdoc item="keyword" value="KeyPgThis|THIS"}}
561+
- {{fbdoc item="keyword" value="KeyPgThiscall|THISCALL"}}
561562
- {{fbdoc item="keyword" value="KeyPgThreadCall|THREADCALL"}}
562563
- {{fbdoc item="keyword" value="KeyPgThreadCreate|THREADCREATE"}}
563564
- {{fbdoc item="keyword" value="KeyPgThreadDetach|THREADDETACH"}}

doc/manual/cache/CatPgFunctIndex.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ List of ""FreeBASIC"" keywords sorted by the function they perform.
534534
- {{fbdoc item="keyword" value="KeyPgMemberSub|SUB (Member)"}}
535535
- {{fbdoc item="keyword" value="KeyPgStdcall|STDCALL"}}
536536
- {{fbdoc item="keyword" value="KeyPgThis|THIS"}}
537+
- {{fbdoc item="keyword" value="KeyPgThiscall|THISCALL"}}
537538
- {{fbdoc item="keyword" value="KeyPgVirtual|VIRTUAL (member)"}}
538539

539540
{{fbdoc item="section" value="Variadic Procedures"}}

doc/manual/cache/CatPgProcedures.wakka

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Keywords that work with procedures.
5454
Specifies the standard calling convention in the C and C""++"" languages.
5555
=={{fbdoc item="keyword" value="KeyPgPascal|Pascal"}}==
5656
Specifies the standard calling convention in the Fortran, Pascal and Microsoft ""QuickBASIC""/QBasic languages.
57+
=={{fbdoc item="keyword" value="KeyPgThicsall|Thiscall"}}==
58+
Specifies the thiscall calling convention for 32-bit member procedures.
5759
<<>>{{anchor name="PARAMCONV"}}{{fbdoc item="section" value="Parameter passing conventions"}}
5860
=={{fbdoc item="keyword" value="KeyPgByref|Byref"}}==
5961
Specifies passing an argument by reference.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{{fbdoc item="title" value="__THISCALL"}}----
2+
Specifies the //Thiscall// calling convention in a member procedure declaration
3+
4+
{{fbdoc item="syntax"}}##
5+
[[KeyPgType|Type]] //typename//
6+
declare [[KeyPgSub|Sub]] //name// **""__Thiscall""** [[[KeyPgOverload|Overload]]] [[[KeyPgAlias|Alias]] //"""alias"""//] ( //parameters// )
7+
declare [[KeyPgFunction|Function]] //name// **""__Thiscall""** [[[KeyPgOverload|Overload]]] [[[KeyPgAlias|Alias]] //"""alias"""//] ( //parameters// ) [ [[KeyPgByrefFunction|Byref]] ] [[KeyPgAs|as]] //return_type//
8+
End Type
9+
##
10+
{{fbdoc item="desc"}}
11+
In member procedure declarations, ##**""__Thiscall""**## specifies that a procedure will use the ##**Thiscall**## calling convention. In the //Thiscall// calling convention, the implicit and hidden [[KeyThis|This]] parameter is passed in the ##ECX## register.
12+
13+
The ##//Thiscall//## calling convention is for 32-bit x86 targets only and is only partially implemented. It should work when using //-gen gcc// backend, but as of fbc-1.08.0, it is not implemented for the //-gen gas// backed.
14+
15+
It is not needed for normal fbc usage, and would typically only be needed for linking to and using ""g++/c++"" libraries.
16+
17+
{{fbdoc item="ex"}}
18+
{{fbdoc item="filename" value="examples/manual/procs/thicall.bas"}}%%(freebasic)
19+
'' __thiscall only makes sense on windows 32-bit
20+
#if defined(__FB_WIN32__) and not defined(__FB_64BIT__)
21+
#define thiscall __thiscall
22+
#else
23+
#define thiscall
24+
#endif
25+
26+
extern "c++"
27+
type UDT
28+
value as long
29+
'' fbc doesn't automatically add the __thiscall calling convention
30+
'' therefore, currently needs to be explicitly given where needed
31+
declare constructor thiscall ()
32+
declare destructor thiscall ()
33+
declare sub someproc thiscall ()
34+
'' etc
35+
end type
36+
end extern
37+
%%
38+
39+
{{fbdoc item="diff"}}
40+
- New to ""FreeBASIC""
41+
42+
{{fbdoc item="see"}}
43+
- ##[[KeyPgCdecl|Cdecl]]##, ##[[KeyPgStdcall|Stdcall]]##
44+
- ##[[KeyPgDeclare|Declare]]##
45+
- ##[[KeyPgSub|Sub]]##, ##[[KeyPgFunction|Function]]##
46+
47+
{{fbdoc item="back" value="CatPgProcedures|Procedures"}}

0 commit comments

Comments
 (0)