View Issue Details

IDProjectCategoryView StatusLast Update
0036949FPCRTLpublic2020-05-02 11:52
ReporterBi0T1N Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0036949: [Patch] Missing ifndef Android in pthread if dynpthreads is not defined
DescriptionThere are some missing {$ifndef ANDROID} if dynpthreads is not defined in pthread.inc compared to the version where dynpthreads is defined.
TagsNo tags attached.
Fixed in Revision45207
FPCOldBugId
FPCTarget-
Attached Files

Activities

Bi0T1N

2020-04-21 21:55

reporter  

01-Add-missing-IFNDEF-Android.patch (3,453 bytes)   
diff --git rtl/linux/pthread.inc rtl/linux/pthread.inc
index 50522c9994..c327a9c81e 100644
--- rtl/linux/pthread.inc
+++ rtl/linux/pthread.inc
@@ -143,33 +143,41 @@ Type
     function pthread_mutex_unlock(__mutex:ppthread_mutex_t):longint;cdecl;external;
     function pthread_mutexattr_init(__attr:ppthread_mutexattr_t):longint;cdecl;external;
     function pthread_mutexattr_destroy(__attr:ppthread_mutexattr_t):longint;cdecl;external;
+{$ifndef ANDROID}
     function pthread_mutexattr_setkind_np(__attr:ppthread_mutexattr_t; __kind:longint):longint;cdecl;external;
     function pthread_mutexattr_getkind_np(__attr:ppthread_mutexattr_t; __kind:plongint):longint;cdecl;external;
+{$endif}
     function pthread_cond_init(__cond:ppthread_cond_t; __cond_attr:ppthread_condattr_t):longint;cdecl;external;
     function pthread_cond_destroy(__cond:ppthread_cond_t):longint;cdecl;external;
     function pthread_cond_signal(__cond:ppthread_cond_t):longint;cdecl;external;
     function pthread_cond_broadcast(__cond:ppthread_cond_t):longint;cdecl;external;
     function pthread_cond_wait(__cond:ppthread_cond_t; __mutex:ppthread_mutex_t):longint;cdecl;external;
     function pthread_cond_timedwait(__cond:ppthread_cond_t; __mutex:ppthread_mutex_t; __abstime:ptimespec):longint;cdecl;external;
+{$ifndef ANDROID}
     function pthread_condattr_init(__attr:ppthread_condattr_t):longint;cdecl;external;
     function pthread_condattr_destroy(__attr:ppthread_condattr_t):longint;cdecl;external;
     function pthread_condattr_setclock(__attr:ppthread_condattr_t; __clock_id: longint):longint;cdecl;external;
+{$endif}
     function pthread_key_create(__key:ppthread_key_t; __destr_function:__destr_function_t):longint;cdecl;external;
     function pthread_key_delete(__key:pthread_key_t):longint;cdecl;external;
     function pthread_setspecific(__key:pthread_key_t; __pointer:pointer):longint;cdecl;external;
     function pthread_getspecific(__key:pthread_key_t):pointer;cdecl;external;
 {    function pthread_once(__once_control:ppthread_once_t; __init_routine:tprocedure ):longint;cdecl;external;}
+{$ifndef ANDROID}
     function pthread_setcancelstate(__state:longint; __oldstate:plongint):longint;cdecl;external;
     function pthread_setcanceltype(__type:longint; __oldtype:plongint):longint;cdecl;external;
     function pthread_cancel(__thread:pthread_t):longint;cdecl;external;
     procedure pthread_testcancel;cdecl;external;
+{$endif}
 {    procedure _pthread_cleanup_push(__buffer:p_pthread_cleanup_buffer;__routine:t_pthread_cleanup_push_routine; __arg:pointer);cdecl;external; }
 {    procedure _pthread_cleanup_push_defer(__buffer:p_pthread_cleanup_buffer;__routine:t_pthread_cleanup_push_defer_routine; __arg:pointer);cdecl;external;}
 {    function pthread_sigmask(__how:longint; __newmask:plibc_sigset; __oldmask:plibc_sigset):longint;cdecl;external;}
     function pthread_kill(__thread:pthread_t; __signo:longint):longint;cdecl;external;
 {    function sigwait(__set:plibc_sigset; __sig:plongint):longint;cdecl;external;}
+{$ifndef ANDROID}
     function pthread_atfork(__prepare:tprocedure ; __parent:tprocedure ; __child:tprocedure ):longint;cdecl;external;
     procedure pthread_kill_other_threads_np;cdecl;external;
+{$endif}
     function pthread_sigmask(how: cint; nset: plibc_sigset; oset: plibc_sigset): cint; cdecl; external;
 
     function sem_init (__sem:Psem_t; __pshared:longint; __value:dword):longint;cdecl;external;

Sven Barth

2020-05-01 15:12

manager   ~0122579

Thank you for the patch.

Please test and close if okay.

Bi0T1N

2020-05-01 17:33

reporter   ~0122581

It's just the other way around than written in the commit msg: exclude the same pthread functions for Android for the static case that are excluded for the dynamic case

Sven Barth

2020-05-02 11:52

manager   ~0122595

You're right. I've fixed the message.

Issue History

Date Modified Username Field Change
2020-04-21 21:55 Bi0T1N New Issue
2020-04-21 21:55 Bi0T1N File Added: 01-Add-missing-IFNDEF-Android.patch
2020-05-01 14:53 Sven Barth Assigned To => Sven Barth
2020-05-01 14:53 Sven Barth Status new => assigned
2020-05-01 15:12 Sven Barth Status assigned => resolved
2020-05-01 15:12 Sven Barth Resolution open => fixed
2020-05-01 15:12 Sven Barth Fixed in Version => 3.3.1
2020-05-01 15:12 Sven Barth Fixed in Revision => 45207
2020-05-01 15:12 Sven Barth FPCTarget => -
2020-05-01 15:12 Sven Barth Note Added: 0122579
2020-05-01 17:33 Bi0T1N Status resolved => closed
2020-05-01 17:33 Bi0T1N Note Added: 0122581
2020-05-02 11:52 Sven Barth Note Added: 0122595