Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Version 1.06.0
- #844: Fix bug in -gen gcc due to duplicated type (struct) names in the main module and global namespace
- #875: Fix bug where boolean variable to single/double conversion gives wrong sign on -gen gas -fpu x87 & sse
- #872: Fix broken boolean bitfield runtime assignments from unsigned values
- #876: ThreadCall does not support subroutine with [U]Long type parameter
- Fixed inline asm procedure name mangling bug (missing underscore prefix) with -gen gcc -asm intel on dos/win32


Expand Down
1 change: 1 addition & 0 deletions src/compiler/rtl-system-thread.bas
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private function hThreadCallMapType _
case FB_DATATYPE_BYTE, FB_DATATYPE_CHAR, FB_DATATYPE_UBYTE, _
FB_DATATYPE_SHORT, FB_DATATYPE_WCHAR, FB_DATATYPE_USHORT, _
FB_DATATYPE_INTEGER, FB_DATATYPE_ENUM, FB_DATATYPE_UINT, _
FB_DATATYPE_LONG, FB_DATATYPE_ULONG, _
FB_DATATYPE_LONGINT, FB_DATATYPE_ULONGINT, _
FB_DATATYPE_SINGLE, FB_DATATYPE_DOUBLE
select case as const( typeGetSizeType( dtype ) )
Expand Down
11 changes: 8 additions & 3 deletions tests/threads/threadcall.bas
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ SUITE( fbc_tests.threads.threadcall_ )
end extern

sub BigInt cdecl( byref i as integer, byref ui as uinteger, _
byref l as longint, byref ul as ulongint )
byref l as longint, byref ul as ulongint, _
byref i4 as long, byref ui4 as ulong _
)

' Output by reference
i = 17
ui = 3
l = 16
ul = 4
i4 = 15
ui4 = 5
end sub

sub FloatStr ( byval s as single, byref d as double, byref s1 as string )
Expand Down Expand Up @@ -113,6 +117,7 @@ SUITE( fbc_tests.threads.threadcall_ )
TEST( default )
dim thread as any ptr
dim i as integer, ui as uinteger, l as longint, ul as ulongint
dim i4 as long, iu4 as ulong
dim d as double
dim as string s1, s2
dim bv as integer ptr, cu as ComplexUDT, AnArray( 0 to 1 ) as string
Expand All @@ -128,7 +133,7 @@ SUITE( fbc_tests.threads.threadcall_ )
SmallInt_Thread = threadcall SmallInt( 20, 1, 19, 2 )
testWindowsMs_thread = threadcall testWindowsMs( )
#endif
BigInt_Thread = threadcall BigInt( i, ui, l, ul )
BigInt_Thread = threadcall BigInt( i, ui, l, ul, i4, iu4 )
s1 = "fourteen"
FloatStr_Thread = threadcall FloatStr( 15.00, d, s1 )
TypeArray_Thread = threadcall TypeArray( su, cu, AnArray(), byval @bv )
Expand All @@ -155,7 +160,7 @@ SUITE( fbc_tests.threads.threadcall_ )
threadwait ONamespace_Thread

'' check byref args
CU_ASSERT_TRUE( i = 17 and ui = 3 and l = 16 and ul = 4 )
CU_ASSERT_TRUE( i = 17 and ui = 3 and l = 16 and ul = 4 and i4 = 15 and iu4 = 5 )
CU_ASSERT_TRUE( d > 12.99 and d < 13.01 and s1 = "five" )
CU_ASSERT_TRUE( cu.c(0) = 7 and cu.c(1) = 11 and cu.c(2) = 8 )
CU_ASSERT_TRUE( cu.d = "ten" and AnArray(0) = "ten" )
Expand Down