As analyzed by Steve, on freebsd __gthread_t is a pointer type.
I thought it the cleanest solution to remove the #ifdef in gfc_unit,
make the "self" member a intptr_t and cast the return value of
__gthread_t to that type.
PR fortran/123512
libgfortran/ChangeLog:
* io/io.h: Change type of self to intptr_t.
* io/async.h (LOCK_UNIT): Cast __gthread_self () to intptr_t.
(TRYLOCK_UNIT): Likewise.
(OWN_THREAD_ID): Likewise.