diff --git a/changelog.txt b/changelog.txt index 1444e931ef..68c8e98d07 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 diff --git a/src/compiler/rtl-system-thread.bas b/src/compiler/rtl-system-thread.bas index 0b3c4235cb..1c8b7b2a99 100644 --- a/src/compiler/rtl-system-thread.bas +++ b/src/compiler/rtl-system-thread.bas @@ -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 ) ) diff --git a/tests/threads/threadcall.bas b/tests/threads/threadcall.bas index b5b52c0cf3..0adb931ce0 100644 --- a/tests/threads/threadcall.bas +++ b/tests/threads/threadcall.bas @@ -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 ) @@ -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 @@ -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 ) @@ -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" )